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:
authorVsevolod Kukol <sevoku@xamarin.com>2016-05-23 15:13:46 +0300
committerVsevolod Kukol <sevoku@xamarin.com>2016-05-23 15:13:46 +0300
commit3d429dc136049b292ec531922d12554162806ce7 (patch)
treec5a945623d384bca1e90cf76334c1da077a5c3a2 /main/src
parent09e9871fdac14cae9e86a2f8c264206c7f5589c5 (diff)
parentf019727ae2405f91cf399aa7e960eb1b102fce78 (diff)
Merge remote-tracking branch 'origin/master' into main-menu-redesign
Diffstat (limited to 'main/src')
-rw-r--r--main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs7
-rw-r--r--main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs2
-rw-r--r--main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs2
-rw-r--r--main/src/addins/AspNet/Execution/XspParameters.cs4
-rw-r--r--main/src/addins/AspNet/Html/DocTypeCompletionData.cs6
-rw-r--r--main/src/addins/AspNet/Html/HtmlParser.cs4
-rw-r--r--main/src/addins/AspNet/Html/HtmlPathCompletion.cs10
-rw-r--r--main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs6
-rw-r--r--main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs6
-rw-r--r--main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs49
-rw-r--r--main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml10
-rw-r--r--main/src/addins/AspNet/Razor/Generator/PreprocessedCSharpRazorCodeParser.cs13
-rw-r--r--main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs2
-rw-r--r--main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs16
-rw-r--r--main/src/addins/AspNet/Razor/RazorCompletion.cs32
-rw-r--r--main/src/addins/AspNet/WebForms/Parser/WebFormsAttributeValueState.cs6
-rw-r--r--main/src/addins/AspNet/WebForms/Parser/WebFormsDirectiveState.cs7
-rw-r--r--main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs24
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsCodeBehind.cs4
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs28
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs8
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs3
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs13
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsParser.cs6
-rw-r--r--main/src/addins/CSharpBinding/CSharpBinding.addin.xml12
-rw-r--r--main/src/addins/CSharpBinding/CSharpBinding.csproj1
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs13
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs7
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs95
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs19
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs11
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs19
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs8
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs10
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs6
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs27
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs8
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs3
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs3
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs22
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/DelegateCreationContextHandler.cs12
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs10
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs25
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs9
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs37
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs5
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs5
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs12
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs68
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFeaturesTextEditorExtension.cs6
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs5
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ConstructFixer.cs208
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindProjectReferenceUsagesHandler.cs50
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs8
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs20
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs424
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs11
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs7
-rw-r--r--main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs2
-rw-r--r--main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs6
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.addin.xml2
-rw-r--r--main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml2
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs2
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs262
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs1
-rw-r--r--main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs1
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.addin.xml1
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.cs67
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.csproj2
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs85
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs6
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs2
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs9
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs2
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/RunButton.cs27
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/SearchBar.cs21
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/SelectorView.cs10
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/StatusBar.cs31
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/Styles.cs5
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs6
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs52
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs55
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyBrowserTypeNodeBuilder.cs7
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyNodeBuilder.cs15
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomEventNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomFieldNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomMethodNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomPropertyNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomTypeNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs10
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs47
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/AttachToProcessDialog.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs7
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs39
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs13
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs8
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs9
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs8
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs84
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs5
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs8
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs8
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs456
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs14
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs25
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs57
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs4
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/Commands.cs4
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs1
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/SwitchBetweenRelatedFilesCommand.cs2
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs35
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs5
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs2
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml2
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs3
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs3
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs1
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj28
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManager.cs5
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepository.cs16
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectManager.cs12
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerTests.cs145
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs3
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs3
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs35
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs22
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs5
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceMonitor.cs (renamed from main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs)17
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs7
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs144
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs5
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs6
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs2
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs3
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs16
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs58
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs1
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameRefactoring.cs83
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs2
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs4
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs111
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs2
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs23
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs13
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs5
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs7
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs4
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs31
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs21
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs142
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic34
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs4
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml4
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs49
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj3
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs16
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config1
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/TestChart.cs9
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs4
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs10
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs22
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs15
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/Library.cs4
-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.csproj1
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/AssemblyInfo.cs2
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.cs64
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs2
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs4
-rw-r--r--main/src/addins/TextTemplating/TextTransform/TextTransform.cs30
-rw-r--r--main/src/addins/VBNetBinding/VBNetBinding.addin.xml6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs1
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs17
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/GitIgnore.txt10
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs20
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs10
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs9
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs9
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs3
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CommonTextEditorOptions.cs8
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs3
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Styles.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj1
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs15
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlInitializer.cs39
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs10
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs19
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml1
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs1
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.LogWidget.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/gui.stetic7
-rw-r--r--main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs4
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs14
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs11
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFTitlebar.cs27
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs10
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs2
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Win32.cs24
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs30
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj1
-rw-r--r--main/src/addins/Xml/Completion/XmlCompletionData.cs10
-rw-r--r--main/src/addins/Xml/Completion/XmlTagCompletionData.cs8
-rw-r--r--main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs6
-rw-r--r--main/src/addins/Xml/Editor/XmlEditorService.cs4
-rw-r--r--main/src/addins/Xml/Editor/XmlTextEditorExtension.cs12
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs93
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs10
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs7
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs59
-rw-r--r--main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml36
-rw-r--r--main/src/core/Mono.Texteditor/SyntaxModes/VBNetSyntaxMode.xml1
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs6
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs8
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/InstrumentationService.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs38
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProjectLoadProgressMonitor.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs4
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj1
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs55
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/Gettext.cs50
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs58
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs8
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs15
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AssemblyReference.cs65
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs47
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs7
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs4
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs7
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs8
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs67
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs38
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs5
-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/AppResult.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs29
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs17
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs49
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs76
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FirstCategory.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs17
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs50
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs32
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs48
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageLoader.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs408
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs111
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs40
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AutoInsertBracketTextEditorExtension.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatcherTextEditorExtension.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs53
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SyntaxModeService.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedCompletionExtension.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedFilterCompletionTextEditorExtension.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs30
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/MimeTypeNode.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs133
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs44
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.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/OptionsDialog.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs17
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs6
-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.ProjectPad/ProjectFileNodeBuilder.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderFileNodeBuilder.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs27
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs45
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs38
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StockIcons.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs58
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs27
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs37
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectController.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/XmlCodeDomReader.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs259
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs19
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs32
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs61
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs46
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.Shared.cs30
-rw-r--r--main/src/core/MonoDevelop.Startup/app.manifest2
387 files changed, 4808 insertions, 3504 deletions
diff --git a/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs b/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs
index 2c437a46ba..2b135358f7 100644
--- a/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs
+++ b/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs
@@ -26,6 +26,7 @@
using System;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.Projects;
@@ -82,9 +83,9 @@ namespace MonoDevelop.AspNet.Commands
outputFile = System.IO.Path.Combine (path, dialog.ViewName) + ext;
if (System.IO.File.Exists (outputFile)) {
- fileGood = MessageService.AskQuestion ("Overwrite file?",
- String.Format ("The file '{0}' already exists.\n", dialog.ViewName) +
- "Would you like to overwrite it?", AlertButton.OverwriteFile, AlertButton.Cancel)
+ fileGood = MessageService.AskQuestion (GettextCatalog.GetString ("Overwrite file?"),
+ GettextCatalog.GetString ("The file '{0}' already exists.\n", dialog.ViewName) +
+ GettextCatalog.GetString ("Would you like to overwrite it?"), AlertButton.OverwriteFile, AlertButton.Cancel)
!= AlertButton.Cancel;
} else
break;
diff --git a/main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs b/main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs
index 2d5c091f3f..0bc8ca0ece 100644
--- a/main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs
+++ b/main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs
@@ -65,7 +65,7 @@ namespace MonoDevelop.AspNet.Commands
if (controller != null)
await RefactoringService.RoslynJumpToDeclaration (controller, doc.Project);
else
- MessageService.ShowError ("Matching controller cannot be found.");
+ MessageService.ShowError (GettextCatalog.GetString ("Matching controller cannot be found."));
}
async Task<INamedTypeSymbol> FindController (MonoDevelop.Projects.Project project, string name)
diff --git a/main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs b/main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs
index f84173bdca..0c0f6459c6 100644
--- a/main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs
+++ b/main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs
@@ -64,7 +64,7 @@ namespace MonoDevelop.AspNet.Commands
}
}
- MessageService.ShowError ("Matching view cannot be found.");
+ MessageService.ShowError (GettextCatalog.GetString ("Matching view cannot be found."));
}
}
}
diff --git a/main/src/addins/AspNet/Execution/XspParameters.cs b/main/src/addins/AspNet/Execution/XspParameters.cs
index e55fd0e541..c5f499071b 100644
--- a/main/src/addins/AspNet/Execution/XspParameters.cs
+++ b/main/src/addins/AspNet/Execution/XspParameters.cs
@@ -80,7 +80,7 @@ namespace MonoDevelop.AspNet.Execution
try {
port = Convert.ToUInt16 (value);
} catch (InvalidCastException) {
- throw new ArgumentException ("The port value is outside the permitted range");
+ throw new ArgumentException (GettextCatalog.GetString ("The port value is outside the permitted range"));
}
}
}
@@ -92,7 +92,7 @@ namespace MonoDevelop.AspNet.Execution
System.Net.IPAddress tempAdd = System.Net.IPAddress.Parse (value);
address = tempAdd.ToString ();
} catch(FormatException) {
- throw new ArgumentException ("The IP address is invalid.");
+ throw new ArgumentException (GettextCatalog.GetString ("The IP address is invalid."));
}
}
}
diff --git a/main/src/addins/AspNet/Html/DocTypeCompletionData.cs b/main/src/addins/AspNet/Html/DocTypeCompletionData.cs
index 254a26da2a..571f8e0125 100644
--- a/main/src/addins/AspNet/Html/DocTypeCompletionData.cs
+++ b/main/src/addins/AspNet/Html/DocTypeCompletionData.cs
@@ -27,7 +27,6 @@
//
using System;
-using System.Threading.Tasks;
using MonoDevelop.Core;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Editor.Extension;
@@ -63,7 +62,7 @@ namespace MonoDevelop.AspNet.Html
get { return name; }
}
- public override Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
var buf = window.CompletionWidget;
if (buf != null) {
@@ -78,8 +77,7 @@ namespace MonoDevelop.AspNet.Html
}
buf.Replace (deleteStartOffset, buf.CaretOffset - deleteStartOffset, text);
- }
- return Task.FromResult (ka);
+ }
}
}
}
diff --git a/main/src/addins/AspNet/Html/HtmlParser.cs b/main/src/addins/AspNet/Html/HtmlParser.cs
index 05f80ff6b3..f42b08c30f 100644
--- a/main/src/addins/AspNet/Html/HtmlParser.cs
+++ b/main/src/addins/AspNet/Html/HtmlParser.cs
@@ -35,7 +35,7 @@ using MonoDevelop.Projects;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
using MonoDevelop.AspNet.Html.Parser;
-using MonoDevelop.Core.Text;
+using MonoDevelop.Core;
namespace MonoDevelop.AspNet.Html
{
@@ -67,7 +67,7 @@ namespace MonoDevelop.AspNet.Html
{
foreach (XNode node in doc.Nodes) {
if (node is XElement && !Object.ReferenceEquals (node, doc.RootElement)) {
- yield return new Error (ErrorType.Warning, "More than one root element", node.Region);
+ yield return new Error (ErrorType.Warning, GettextCatalog.GetString ("More than one root element"), node.Region);
}
}
}
diff --git a/main/src/addins/AspNet/Html/HtmlPathCompletion.cs b/main/src/addins/AspNet/Html/HtmlPathCompletion.cs
index 9609ad048f..76493955a1 100644
--- a/main/src/addins/AspNet/Html/HtmlPathCompletion.cs
+++ b/main/src/addins/AspNet/Html/HtmlPathCompletion.cs
@@ -31,8 +31,7 @@ using MonoDevelop.Core;
using System.Text.RegularExpressions;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Editor.Extension;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.AspNet.Html
{
public static class HtmlPathCompletion
@@ -118,21 +117,20 @@ namespace MonoDevelop.AspNet.Html
get { throw new InvalidOperationException (); }
}
- public override Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
string text;
var dialog = new MonoDevelop.Ide.Projects.ProjectFileSelectorDialog (proj, "", pattern);
try {
if (MessageService.RunCustomDialog (dialog) != (int)Gtk.ResponseType.Ok || dialog.SelectedFile == null)
- return Task.FromResult (ka);
+ return;
text = pathFunc (dialog.SelectedFile);
}
finally {
dialog.Destroy ();
dialog.Dispose ();
}
- window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, "", text);
- return Task.FromResult (ka);
+ window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, "", text);
}
}
}
diff --git a/main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs b/main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs
index bcbab2276b..d680cda5a1 100644
--- a/main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs
+++ b/main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs
@@ -95,9 +95,9 @@ namespace MonoDevelop.AspNet.ProjectPad
outputFile = System.IO.Path.Combine (path, dialog.ControllerName) + ".cs";
if (System.IO.File.Exists (outputFile)) {
- fileGood = MessageService.AskQuestion ("Overwrite file?",
- String.Format ("The file '{0}' already exists.\n", dialog.ControllerName) +
- "Would you like to overwrite it?", AlertButton.OverwriteFile, AlertButton.Cancel)
+ fileGood = MessageService.AskQuestion (GettextCatalog.GetString ("Overwrite file?"),
+ GettextCatalog.GetString ("The file '{0}' already exists.\n", dialog.ControllerName) +
+ GettextCatalog.GetString ("Would you like to overwrite it?"), AlertButton.OverwriteFile, AlertButton.Cancel)
!= AlertButton.Cancel;
} else
break;
diff --git a/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs b/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs
index 1527fa9c43..da751481b6 100644
--- a/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs
+++ b/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs
@@ -208,7 +208,7 @@ namespace MonoDevelop.AspNet.Projects
});
}
- monitor.Log.WriteLine ("Running web server...");
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Running web server..."));
var op = context.ExecutionHandler.Execute (cmd, console);
@@ -222,13 +222,13 @@ namespace MonoDevelop.AspNet.Projects
using (monitor.CancellationToken.Register (op.Cancel))
await op.Task;
- monitor.Log.WriteLine ("The web server exited with code: {0}", op.ExitCode);
+ monitor.Log.WriteLine (GettextCatalog.GetString ("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);
+ monitor.ReportError (GettextCatalog.GetString ("Could not launch web server."), ex);
} finally {
if (console != null)
console.Dispose ();
diff --git a/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs b/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs
index 699afe4c5a..2df1750d4a 100644
--- a/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs
+++ b/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs
@@ -59,12 +59,10 @@ namespace MonoDevelop.AspNet.Projects
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);
+ backgroundImageView.Xalign = 1.0f;
+ backgroundImageView.Yalign = 1.0f;
backgroundLargeImageVBox.PackStart (backgroundImageView, true, true, 0);
var separatorColor = Ide.Gui.Styles.NewProjectDialog.ProjectConfigurationSeparatorColor.ToGdkColor ();
@@ -76,9 +74,6 @@ namespace MonoDevelop.AspNet.Projects
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)
@@ -87,46 +82,6 @@ namespace MonoDevelop.AspNet.Projects
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);
diff --git a/main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml b/main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml
index 26b5866a02..b39dcd0319 100644
--- a/main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml
+++ b/main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml
@@ -81,11 +81,11 @@
</ExtensionPoint>
<Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <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-WebApplication"
+ <ProjectTemplate id = "MonoDevelop.AspNet.WebApplication"
file = "Templates/Projects/WebFormsProject.xpt.xml"/>
</Extension>
@@ -265,10 +265,6 @@
<NodeBuilder id="AspNetFolderNodeBuilderExtension" class = "MonoDevelop.AspNet.ProjectPad.AspNetFolderNodeBuilderExtension"/>
</Extension>
- <Extension path = "/MonoDevelop/SourceEditor2/CustomModes">
- <SyntaxMode mimeTypes="application/x-aspx" class="MonoDevelop.AspNet.WebForms.WebFormsSyntaxMode"/>
- </Extension>
-
<Extension path = "/MonoDevelop/Core/MimeTypes">
<MimeType id="application/x-aspx" _description="ASP.NET page" icon="md-html-file-icon" isText="true">
<File pattern="*.aspx" />
diff --git a/main/src/addins/AspNet/Razor/Generator/PreprocessedCSharpRazorCodeParser.cs b/main/src/addins/AspNet/Razor/Generator/PreprocessedCSharpRazorCodeParser.cs
index b82323703d..1c8a5cf256 100644
--- a/main/src/addins/AspNet/Razor/Generator/PreprocessedCSharpRazorCodeParser.cs
+++ b/main/src/addins/AspNet/Razor/Generator/PreprocessedCSharpRazorCodeParser.cs
@@ -16,6 +16,7 @@ using System.Web.Razor.Generator;
using System.Web.Razor.Parser;
using System.Web.Razor.Parser.SyntaxTree;
using System.Web.Razor.Text;
+using MonoDevelop.Core;
namespace MonoDevelop.AspNet.Razor.Generator
{
@@ -41,7 +42,7 @@ namespace MonoDevelop.AspNet.Razor.Generator
if (split.Length == 1) {
return new PropertyCodeGenerator (split[0], "Model");
}
- Context.OnError (l, string.Format ("The '{0}' directive requires exactly one argument", ModelKeyword));
+ Context.OnError (l, GettextCatalog.GetString ("The '{0}' directive requires exactly one argument", ModelKeyword));
return null;
});
}
@@ -53,7 +54,7 @@ namespace MonoDevelop.AspNet.Razor.Generator
if (split.Length == 2) {
return new PropertyCodeGenerator (split[0], split[1]);
}
- Context.OnError (l, string.Format ("The '{0}' directive requires exactly two arguments", PropertyKeyword));
+ Context.OnError (l, GettextCatalog.GetString ("The '{0}' directive requires exactly two arguments", PropertyKeyword));
return null;
});
}
@@ -63,7 +64,7 @@ namespace MonoDevelop.AspNet.Razor.Generator
ValueDirective (ClassKeyword, true, (s, l) => {
var split = GetArgumentWords (s);
if (split.Length != 1 && split.Length != 2) {
- Context.OnError (l, string.Format ("The '{0}' directive requires one or two arguments", ClassKeyword));
+ Context.OnError (l, GettextCatalog.GetString ("The '{0}' directive requires one or two arguments", ClassKeyword));
return null;
}
string name = null, access = null;
@@ -74,7 +75,7 @@ namespace MonoDevelop.AspNet.Razor.Generator
}
if (split.Length == 2) {
if (access == null) {
- string err = "If '{0}' directive has two arguments, the first must be 'public' or 'internal'.";
+ string err = GettextCatalog.GetString ("If '{0}' directive has two arguments, the first must be 'public' or 'internal'.");
Context.OnError (l, string.Format (err, ClassKeyword));
return null;
}
@@ -97,12 +98,12 @@ namespace MonoDevelop.AspNet.Razor.Generator
if (checkOne && !directives.Add (keyword)) {
Context.OnError (
CurrentLocation,
- string.Format ("Only one '{0}' directive is permitted", keyword)
+ GettextCatalog.GetString ("Only one '{0}' directive is permitted", keyword)
);
}
SourceLocation location = CurrentLocation;
BaseTypeDirective (
- string.Format ("The '{0}' directive must have a value", keyword),
+ GettextCatalog.GetString ("The '{0}' directive must have a value", keyword),
s => s != null ? valueParsed (s, location) : null
);
}
diff --git a/main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs b/main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs
index 28136349c2..402e78090d 100644
--- a/main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs
+++ b/main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs
@@ -51,7 +51,7 @@ namespace MonoDevelop.AspNet.Razor.Generator
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";
+ string msg = GettextCatalog.GetString ("Razor templates are only supported in C# projects");
result.Errors.Add (new CompilerError (file.Name, -1, -1, null, msg));
monitor.Log.WriteLine (msg);
return;
diff --git a/main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs b/main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs
index cec88ae560..1fc3994145 100644
--- a/main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs
+++ b/main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs
@@ -242,11 +242,11 @@ namespace MonoDevelop.AspNet.Razor
XObject prevNode;
bool updateNeeded;
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
Tracker.UpdateEngine ();
if (razorDocument == null)
- return await NonCSharpCompletion (descriptor);
+ return NonCSharpCompletion (descriptor);
var n = Tracker.Engine.Nodes.Peek ();
if (prevNode is RazorExpression && !(n is RazorExpression))
@@ -263,20 +263,20 @@ namespace MonoDevelop.AspNet.Razor
// 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 await NonCSharpCompletion (descriptor);
+ return NonCSharpCompletion (descriptor);
// Determine if we are inside generics
if (previousChar == '<') {
var codeState = state as RazorCodeFragmentState;
if (codeState == null || !codeState.IsInsideGenerics)
- return await NonCSharpCompletion (descriptor);
+ return NonCSharpCompletion (descriptor);
}
// Determine whether we begin an html tag or generics
else if (descriptor.KeyChar == '<' && (n is XElement || !Char.IsLetterOrDigit (previousChar)))
- return await NonCSharpCompletion (descriptor);
+ 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 await NonCSharpCompletion (descriptor);
+ return NonCSharpCompletion (descriptor);
// We're in C# context
InitializeCodeCompletion ();
@@ -284,7 +284,7 @@ namespace MonoDevelop.AspNet.Razor
bool result;
try {
- result = await base.KeyPress (descriptor);
+ result = base.KeyPress (descriptor);
if (/*EnableParameterInsight &&*/ (descriptor.KeyChar == ',' || descriptor.KeyChar == ')') && CanRunParameterCompletionCommand ())
base.RunParameterCompletionCommand ();
} finally {
@@ -310,7 +310,7 @@ namespace MonoDevelop.AspNet.Razor
CompletionWidget = defaultCompletionWidget;
}
- Task<bool> NonCSharpCompletion (KeyDescriptor descriptor)
+ bool NonCSharpCompletion (KeyDescriptor descriptor)
{
isInCSharpContext = false;
return base.KeyPress (descriptor);
diff --git a/main/src/addins/AspNet/Razor/RazorCompletion.cs b/main/src/addins/AspNet/Razor/RazorCompletion.cs
index 0fc246cb4c..953209bfa5 100644
--- a/main/src/addins/AspNet/Razor/RazorCompletion.cs
+++ b/main/src/addins/AspNet/Razor/RazorCompletion.cs
@@ -43,37 +43,37 @@ namespace MonoDevelop.AspNet.Razor
{
string icon = "md-keyword";
- list.Add ("helper", icon, "Defines a helper");
- list.Add ("functions", icon, "Defines a region of class members");
- list.Add ("using", icon, "Imports a namespace");
+ list.Add ("helper", icon, GettextCatalog.GetString ("Defines a helper"));
+ list.Add ("functions", icon, GettextCatalog.GetString ("Defines a region of class members"));
+ list.Add ("using", icon, GettextCatalog.GetString ("Imports a namespace"));
if (kind == RazorHostKind.WebCode)
return;
- list.Add ("inherits", icon, "Defines a base class of the view");
- list.Add ("model", icon, "References a strongly-typed model");
+ list.Add ("inherits", icon, GettextCatalog.GetString ("Defines a base class of the view"));
+ list.Add ("model", icon, GettextCatalog.GetString ("References a strongly-typed model"));
if (kind == RazorHostKind.WebPage) {
- list.Add ("layout", icon, "Defines a layout file to use in this view");
- list.Add ("sessionstate", icon, "Defines a sessionstate mode");
- list.Add ("section", icon, "Defines a section");
+ list.Add ("layout", icon, GettextCatalog.GetString ("Defines a layout file to use in this view"));
+ list.Add ("sessionstate", icon, GettextCatalog.GetString ("Defines a sessionstate mode"));
+ list.Add ("section", icon, GettextCatalog.GetString ("Defines a section"));
} else if (kind == RazorHostKind.Template) {
- list.Add ("__class", icon, "Customizes the generated class");
- list.Add ("__property", icon, "Adds a property");
+ list.Add ("__class", icon, GettextCatalog.GetString ("Customizes the generated class"));
+ list.Add ("__property", icon, GettextCatalog.GetString ("Adds a property"));
}
}
static void AddRazorTemplates (CompletionDataList list, RazorHostKind kind)
{
string icon = "md-template";
- list.Add ("inherits", icon, "Template for inherits directive");
- list.Add ("model", icon, "Template for model directive");
- list.Add ("helper", icon, "Template for helper directive");
- list.Add ("functions", icon, "Template for functions directive");
- list.Add ("using", icon, "Template for using statement");
+ list.Add ("inherits", icon, GettextCatalog.GetString ("Template for inherits directive"));
+ list.Add ("model", icon, GettextCatalog.GetString ("Template for model directive"));
+ list.Add ("helper", icon, GettextCatalog.GetString ("Template for helper directive"));
+ list.Add ("functions", icon, GettextCatalog.GetString ("Template for functions directive"));
+ list.Add ("using", icon, GettextCatalog.GetString ("Template for using statement"));
if (kind == RazorHostKind.WebPage) {
- list.Add ("section", icon, "Template for section directive");
+ list.Add ("section", icon, GettextCatalog.GetString ("Template for section directive"));
}
}
diff --git a/main/src/addins/AspNet/WebForms/Parser/WebFormsAttributeValueState.cs b/main/src/addins/AspNet/WebForms/Parser/WebFormsAttributeValueState.cs
index 474089d774..69deb5b576 100644
--- a/main/src/addins/AspNet/WebForms/Parser/WebFormsAttributeValueState.cs
+++ b/main/src/addins/AspNet/WebForms/Parser/WebFormsAttributeValueState.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-
+using MonoDevelop.Core;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
using MonoDevelop.AspNet.WebForms.Dom;
@@ -79,7 +79,7 @@ namespace MonoDevelop.AspNet.WebForms.Parser
return null;
}
if (c == '@') {
- context.LogError ("Invalid directive location");
+ context.LogError (GettextCatalog.GetString ("Invalid directive location"));
rollback = "<%";
return Parent;
}
@@ -92,7 +92,7 @@ namespace MonoDevelop.AspNet.WebForms.Parser
SetTag (context, AttState.Comment);
return null;
}
- context.LogError ("Malformed server comment");
+ context.LogError (GettextCatalog.GetString ("Malformed server comment"));
rollback = "<%-";
return Parent;
case AttState.Expression:
diff --git a/main/src/addins/AspNet/WebForms/Parser/WebFormsDirectiveState.cs b/main/src/addins/AspNet/WebForms/Parser/WebFormsDirectiveState.cs
index adb91a3091..fe650c3c92 100644
--- a/main/src/addins/AspNet/WebForms/Parser/WebFormsDirectiveState.cs
+++ b/main/src/addins/AspNet/WebForms/Parser/WebFormsDirectiveState.cs
@@ -29,6 +29,7 @@
using System;
using System.Diagnostics;
+using MonoDevelop.Core;
using MonoDevelop.Xml.Parser;
using MonoDevelop.AspNet.WebForms.Dom;
using MonoDevelop.Xml.Dom;
@@ -69,7 +70,7 @@ namespace MonoDevelop.AspNet.WebForms.Parser
}
if (c == '<') {
- context.LogError ("Unexpected '<' in directive.");
+ context.LogError (GettextCatalog.GetString ("Unexpected '<' in directive."));
rollback = string.Empty;
return Parent;
}
@@ -88,7 +89,7 @@ namespace MonoDevelop.AspNet.WebForms.Parser
context.Nodes.Pop ();
if (!directive.IsNamed) {
- context.LogError ("Directive closed prematurely.");
+ context.LogError (GettextCatalog.GetString ("Directive closed prematurely."));
} else {
directive.End (context.Location);
if (context.BuildTree) {
@@ -110,7 +111,7 @@ namespace MonoDevelop.AspNet.WebForms.Parser
return null;
rollback = string.Empty;
- context.LogError ("Unexpected character '" + c + "' in tag.");
+ context.LogError (GettextCatalog.GetString ("Unexpected character '{0}' in tag.", c));
return Parent;
}
}
diff --git a/main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs b/main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs
index bc4ad6fe86..9c779f2a55 100644
--- a/main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs
+++ b/main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs
@@ -35,8 +35,7 @@ using MonoDevelop.DesignerSupport;
using System.Linq;
using MonoDevelop.Ide.Editor.Extension;
using Microsoft.CodeAnalysis;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.AspNet.WebForms
{
class SuggestedHandlerCompletionData : CompletionData
@@ -76,22 +75,21 @@ namespace MonoDevelop.AspNet.WebForms
}
}
- public override Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
//insert the method name
var buf = window.CompletionWidget;
if (buf != null) {
buf.Replace (window.CodeCompletionContext.TriggerOffset, buf.CaretOffset - window.CodeCompletionContext.TriggerOffset, methodInfo.Name);
- }
-
- //generate the codebehind method
-
- // 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);
- return Task.FromResult (ka);
+ }
+
+ //generate the codebehind method
+
+ // 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 d735e979ca..c26b4b7ab6 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsCodeBehind.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsCodeBehind.cs
@@ -77,7 +77,7 @@ namespace MonoDevelop.AspNet.WebForms
//parse the ASP.NET file
var parsedDocument = TypeSystemService.ParseFile (project, file.FilePath).Result as WebFormsParsedDocument;
if (parsedDocument == null) {
- result.AddError (string.Format ("Failed to parse file '{0}'", file.Name));
+ result.AddError (GettextCatalog.GetString ("Failed to parse file '{0}'", file.Name));
return result;
}
@@ -162,7 +162,7 @@ namespace MonoDevelop.AspNet.WebForms
LoggingService.LogWarning ("Error resolving master page type", ex);
}
if (string.IsNullOrEmpty (masterTypeName)) {
- var msg = string.Format ("Could not find type for master '{0}'", document.Info.MasterPageTypeVPath);
+ var msg = GettextCatalog.GetString ("Could not find type for master '{0}'", document.Info.MasterPageTypeVPath);
result.AddError (filename, msg);
return result;
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs b/main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs
index a7ded63cf7..7092bd87f1 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs
@@ -66,30 +66,30 @@ namespace MonoDevelop.AspNet.WebForms
CompletionDataList list = new CompletionDataList ();
if (type == WebSubtype.WebForm) {
- list.Add ("Implements", null, "Declare that this page implements an interface.");
- list.Add ("Page", null, "Define properties of this page.");
- list.Add ("PreviousPageType", null, "Strongly type the page's PreviousPage property.");
- list.Add ("MasterType", null, "Strongly type the page's Master property.");
+ list.Add ("Implements", null, GettextCatalog.GetString ("Declare that this page implements an interface."));
+ list.Add ("Page", null, GettextCatalog.GetString ("Define properties of this page."));
+ list.Add ("PreviousPageType", null, GettextCatalog.GetString ("Strongly type the page's PreviousPage property."));
+ list.Add ("MasterType", null, GettextCatalog.GetString ("Strongly type the page's Master property."));
} else if (type == WebSubtype.MasterPage) {
- list.Add ("Implements", null, "Declare that this master page implements an interface.");
- list.Add ("Master", null, "Define properties of this master page.");
- list.Add ("MasterType", null, "Strongly type the page's Master property.");
+ list.Add ("Implements", null, GettextCatalog.GetString ("Declare that this master page implements an interface."));
+ list.Add ("Master", null, GettextCatalog.GetString ("Define properties of this master page."));
+ list.Add ("MasterType", null, GettextCatalog.GetString ("Strongly type the page's Master property."));
} else if (type == WebSubtype.WebControl) {
- list.Add ("Control", null, "Define properties of this user control.");
- list.Add ("Implements", null, "Declare that this control implements an interface.");
+ list.Add ("Control", null, GettextCatalog.GetString ("Define properties of this user control."));
+ list.Add ("Implements", null, GettextCatalog.GetString ("Declare that this control implements an interface."));
} else {
return null;
}
- list.Add ("Assembly", null, "Reference an assembly.");
- list.Add ("Import", null, "Import a namespace.");
+ list.Add ("Assembly", null, GettextCatalog.GetString ("Reference an assembly."));
+ list.Add ("Import", null, GettextCatalog.GetString ("Import a namespace."));
if (type != WebSubtype.MasterPage) {
- list.Add ("OutputCache", null, "Set output caching behaviour.");
+ list.Add ("OutputCache", null, GettextCatalog.GetString ("Set output caching behaviour."));
}
- list.Add ("Reference", null, "Reference a page or user control.");
- list.Add ("Register", null, "Register a user control or custom web controls.");
+ list.Add ("Reference", null, GettextCatalog.GetString ("Reference a page or user control."));
+ list.Add ("Register", null, GettextCatalog.GetString ("Register a user control or custom web controls."));
return list.Count > 0? list : null;
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs b/main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs
index 85ecdd8333..317ab2acb8 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs
@@ -297,19 +297,19 @@ namespace MonoDevelop.AspNet.WebForms
// return documentBuilder.HandleCompletion (defaultEditor, defaultDocumentContext, completionContext, documentInfo, localDocumentInfo, completionChar, ref triggerWordLength);
// }
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
Tracker.UpdateEngine ();
bool isAspExprState = Tracker.Engine.CurrentState is WebFormsExpressionState;
if (documentBuilder == null || !isAspExprState)
- return await base.KeyPress (descriptor);
+ return base.KeyPress (descriptor);
InitializeCodeCompletion ('\0');
// DocumentContext = localDocumentInfo.HiddenDocument;
// Editor = localDocumentInfo.HiddenDocument.Editor;
// CompletionWidget = documentBuilder.CreateCompletionWidget (localDocumentInfo.HiddenDocument.Editor, localDocumentInfo.HiddenDocument, localDocumentInfo);
bool result;
try {
- result = await base.KeyPress (descriptor);
+ result = base.KeyPress (descriptor);
if (PropertyService.Get ("EnableParameterInsight", true) && (descriptor.KeyChar == ',' || descriptor.KeyChar == ')') && CanRunParameterCompletionCommand ()) {
RunParameterCompletionCommand ();
}
@@ -324,7 +324,7 @@ namespace MonoDevelop.AspNet.WebForms
// TODO: Roslyn port
// public override ParameterHintingResult HandleParameterCompletionAsync (CodeCompletionContext completionContext, char completionChar)
// {
-///* if (Tracker.Engine.CurrentState is AspNetExpressionState && documentBuilder != null && localDocumentInfo != null) {
+// /* if (Tracker.Engine.CurrentState is AspNetExpressionState && documentBuilder != null && localDocumentInfo != null) {
// return documentBuilder.HandleParameterCompletion (defaultDocument, completionContext, documentInfo, localDocumentInfo, completionChar);
// }*/
//
diff --git a/main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs b/main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs
index 5ea9c7cba6..c6ddb8ba79 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs
@@ -68,7 +68,8 @@ namespace MonoDevelop.AspNet.WebForms
foreach (XElement el in xDocument.Nodes.OfType<XElement> ())
AddMember (el);
} catch (Exception ex) {
- Errors.Add (new Error (ErrorType.Error, "Unknown parser error: " + ex));
+ LoggingService.LogError ("Unknown parser error: {0}", ex);
+ Errors.Add (new Error (ErrorType.Error, GettextCatalog.GetString ("Unknown parser error: {0}", ex.Message)));
}
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs b/main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs
index 5220656f16..3b1cf53a75 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.WebForms.Dom;
+using MonoDevelop.Core;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Ide.TypeSystem;
@@ -103,7 +104,7 @@ namespace MonoDevelop.AspNet.WebForms
break;
case "mastertype":
if (MasterPageTypeVPath != null || MasterPageTypeName != null) {
- errors.Add (new Error (ErrorType.Error, "Unexpected second mastertype directive", directive.Region));
+ errors.Add (new Error (ErrorType.Error, GettextCatalog.GetString ("Unexpected second mastertype directive"), directive.Region));
return;
}
MasterPageTypeName = GetAttributeValueCI (directive.Attributes, "typename");
@@ -111,7 +112,7 @@ namespace MonoDevelop.AspNet.WebForms
if (string.IsNullOrEmpty (MasterPageTypeName) == string.IsNullOrEmpty (MasterPageTypeVPath))
errors.Add (new Error (
ErrorType.Error,
- "Mastertype directive must have non-empty 'typename' or 'virtualpath' attribute",
+ GettextCatalog.GetString ("Mastertype directive must have non-empty 'typename' or 'virtualpath' attribute"),
directive.Region
)
);
@@ -138,7 +139,7 @@ namespace MonoDevelop.AspNet.WebForms
else
errors.Add (new Error (
ErrorType.Error,
- "Assembly directive must have non-empty 'name' or 'src' attribute",
+ GettextCatalog.GetString ("Assembly directive must have non-empty 'name' or 'src' attribute"),
directive.Region
)
);
@@ -150,7 +151,7 @@ namespace MonoDevelop.AspNet.WebForms
else
errors.Add (new Error (
ErrorType.Error,
- "Import directive must have non-empty 'namespace' attribute",
+ GettextCatalog.GetString ("Import directive must have non-empty 'namespace' attribute"),
directive.Region
)
);
@@ -162,7 +163,7 @@ namespace MonoDevelop.AspNet.WebForms
else
errors.Add (new Error (
ErrorType.Error,
- "Implements directive must have non-empty 'interface' attribute",
+ GettextCatalog.GetString ("Implements directive must have non-empty 'interface' attribute"),
directive.Region
)
);
@@ -175,7 +176,7 @@ namespace MonoDevelop.AspNet.WebForms
void SetSubtype (WebSubtype type, WebFormsDirective directive, List<Error> errors)
{
if (Subtype != WebSubtype.None) {
- errors.Add (new Error (ErrorType.Error, "Unexpected directive " + directive.Name.FullName, directive.Region));
+ errors.Add (new Error (ErrorType.Error, GettextCatalog.GetString ("Unexpected directive {0}", directive.Name.FullName), directive.Region));
return;
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsParser.cs b/main/src/addins/AspNet/WebForms/WebFormsParser.cs
index ba38dd44d7..4093d60ccb 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsParser.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsParser.cs
@@ -58,7 +58,7 @@ namespace MonoDevelop.AspNet.WebForms
parser.Parse (parseOptions.Content.CreateReader ());
} catch (Exception 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));
+ errors.Add (new Error (ErrorType.Error, GettextCatalog.GetString ("Unhandled error parsing ASP.NET document: {0}", ex.Message)));
}
// get the errors from the StateEngine parser
@@ -71,10 +71,10 @@ namespace MonoDevelop.AspNet.WebForms
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", new DocumentLocation (1, 1)));
+ errors.Add (new Error (ErrorType.Error, GettextCatalog.GetString ("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", new DocumentLocation (1, 1)));
+ errors.Add (new Error (ErrorType.Warning, GettextCatalog.GetString ("File directive does not match page extension"), new DocumentLocation (1, 1)));
}
}
diff --git a/main/src/addins/CSharpBinding/CSharpBinding.addin.xml b/main/src/addins/CSharpBinding/CSharpBinding.addin.xml
index c5feafc362..f608360892 100644
--- a/main/src/addins/CSharpBinding/CSharpBinding.addin.xml
+++ b/main/src/addins/CSharpBinding/CSharpBinding.addin.xml
@@ -102,13 +102,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>
diff --git a/main/src/addins/CSharpBinding/CSharpBinding.csproj b/main/src/addins/CSharpBinding/CSharpBinding.csproj
index abe265cc2a..7e33495d05 100644
--- a/main/src/addins/CSharpBinding/CSharpBinding.csproj
+++ b/main/src/addins/CSharpBinding/CSharpBinding.csproj
@@ -828,6 +828,7 @@
<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" />
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs
index a14f6603a5..29e0d44547 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs
@@ -36,6 +36,7 @@ using Microsoft.CodeAnalysis.Simplification;
using ICSharpCode.NRefactory6.CSharp;
using Gtk;
using MonoDevelop.Ide.TypeSystem;
+using ICSharpCode.NRefactory6.CSharp.ExtractMethod;
namespace MonoDevelop.CodeGeneration
{
@@ -115,8 +116,16 @@ namespace MonoDevelop.CodeGeneration
foreach (IPropertySymbol property in Options.EnclosingType.GetMembers ().OfType<IPropertySymbol> ()) {
if (property.IsImplicitlyDeclared)
continue;
- if (property.SetMethod == null)
- continue;
+ if (property.SetMethod == null) {
+ if (property.GetMethod == null)
+ continue;
+ var r = property.GetMethod.DeclaringSyntaxReferences.FirstOrDefault ();
+ if (r == null)
+ continue;
+ var node = r.SyntaxTree.GetRoot ().FindNode (r.Span) as AccessorDeclarationSyntax;
+ if (node == null || node.GetBlockBody () != null)
+ continue;
+ }
yield return property;
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs
index f150e59a13..9aed680e48 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs
@@ -126,17 +126,18 @@ namespace MonoDevelop.CodeGeneration
{
var format = new StringBuilder ();
int i = 0;
+ format.Append ("$\"");
foreach (var member in includedMembers) {
if (i > 0)
format.Append (", ");
format.Append (GetName (member));
format.Append ("={");
- format.Append (i++);
+ format.Append (member.ToString ());
format.Append ("}");
}
-
+ format.Append ("\"");
var arguments = new List<ArgumentSyntax> ();
- arguments.Add (SyntaxFactory.Argument (SyntaxFactory.LiteralExpression (SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal (format.ToString ()))));
+ arguments.Add (SyntaxFactory.Argument (SyntaxFactory.ParseExpression (format.ToString ())));
var node =
SyntaxFactory.ExpressionStatement (
SyntaxFactory.InvocationExpression (
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs
index 0f4728caa5..726fab186d 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs
@@ -24,46 +24,47 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Core;
namespace ICSharpCode.NRefactory6.CSharp
{
- static class Resources
+ 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 GenerateConstructor = GettextCatalog.GetString ("Generate constructor '{0}({1})'");
+ public static string GenerateFieldAssigningConstructor = GettextCatalog.GetString ("Generate field assigning constructor '{0}({1})'");
+ public static string GenerateDelegatingConstructor = GettextCatalog.GetString ("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 GenerateEnumMemberIn = GettextCatalog.GetString ("Generate enum member '{0}' in '{1}'");
+ public static string GenerateNewConstructorIn = GettextCatalog.GetString ("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 GenerateAbstractMethod = GettextCatalog.GetString ("Generate abstract method '{0}' in '{1}'");
+ public static string GenerateAbstractProperty = GettextCatalog.GetString ("Generate abstract property '{0}' in '{1}'");
+ public static string GeneratePropertyIn = GettextCatalog.GetString ("Generate property '{1}.{0}'");
+ public static string GenerateMethodIn = GettextCatalog.GetString ("Generate method '{1}.{0}'");
- public static string GenerateAll = "Generate all";
+ public static string GenerateAll = GettextCatalog.GetString ("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 GenerateConstantIn = GettextCatalog.GetString ("Generate constant '{0}' in '{1}'");
+ public static string GenerateReadonlyProperty = GettextCatalog.GetString ("Generate read-only property '{1}.{0}'");
+ public static string GenerateReadonlyField = GettextCatalog.GetString ("Generate read-only field '{1}.{0}'");
+ public static string GenerateFieldIn = GettextCatalog.GetString ("Generate field '{0}' in '{1}'");
+ public static string GenerateLocal = GettextCatalog.GetString ("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 ImplementInterface = GettextCatalog.GetString ("Implement interface");
+ public static string ImplementInterfaceAbstractly = GettextCatalog.GetString ("Implement interface abstractly");
+ public static string ImplementInterfaceExplicitly = GettextCatalog.GetString ("Implement interface explicitly");
+ public static string ImplementInterfaceExplicitlyWithDisposePattern = GettextCatalog.GetString ("Implement interface explicitly with Dispose pattern");
+ public static string ImplementInterfaceThrough = GettextCatalog.GetString ("Implement interface through '{0}'");
+ public static string ImplementInterfaceWithDisposePattern = GettextCatalog.GetString ("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 ImplicitConversionDisplayText = GettextCatalog.GetString ("Generate implicit conversion operator in '{0}'");
+ public static string ExplicitConversionDisplayText = GettextCatalog.GetString ("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 GenerateForIn = GettextCatalog.GetString ("Generate {0} for '{1}' in '{2}'");
+ public static string GenerateForInNewFile = GettextCatalog.GetString ("Generate {0} for '{1}' in '{2}' (new file)");
+ public static string GlobalNamespace = GettextCatalog.GetString ("Global Namespace");
+ public static string GenerateNewType = GettextCatalog.GetString ("Generate new type...");
+ public static string ToDetectRedundantCalls = GettextCatalog.GetString ("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.";
@@ -74,25 +75,25 @@ namespace ICSharpCode.NRefactory6.CSharp
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 IntroduceConstantFor = GettextCatalog.GetString ("Introduce constant for '{0}'");
+ public static string IntroduceConstantForAllOccurrences = GettextCatalog.GetString ("Introduce constant for all occurrences of '{0}'");
+ public static string IntroduceFieldFor = GettextCatalog.GetString ("Introduce field for '{0}'");
+ public static string IntroduceFieldForAllOccurrences = GettextCatalog.GetString ("Introduce field for all occurrences of '{0}'");
+ public static string IntroduceLocalConstantFor = GettextCatalog.GetString ("Introduce local constant for '{0}'");
+ public static string IntroduceLocalConstantForAll = GettextCatalog.GetString ("Introduce local constant for all occurrences of '{0}'");
+ public static string IntroduceLocalFor = GettextCatalog.GetString ("Introduce local for '{0}'");
+ public static string IntroduceLocalForAllOccurrences = GettextCatalog.GetString ("Introduce local for all occurrences of '{0}'");
+ public static string IntroduceQueryVariableFor = GettextCatalog.GetString ("Introduce query variable for '{0}'");
+ public static string IntroduceQueryVariableForAll = GettextCatalog.GetString ("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)";
+ public static string OrganizeUsingsWithAccelerator = GettextCatalog.GetString ("_Organize Usings");
+ public static string RemoveAndSortUsingsWithAccelerator = GettextCatalog.GetString ("Remove _and Sort Usings");
+ public static string SortUsingsWithAccelerator = GettextCatalog.GetString ("_Sort Usings");
+ public static string RemoveUnnecessaryUsingsWithAccelerator = GettextCatalog.GetString ("_Remove Unnecessary Usings");
+ public static string EncapsulateFieldsUsages = GettextCatalog.GetString ("Encapsulate fields (and use property)");
+ public static string EncapsulateFields = GettextCatalog.GetString ("Encapsulate fields (but still use field)");
+ public static string EncapsulateFieldUsages = GettextCatalog.GetString ("Encapsulate field: '{0}' (and use property)");
+ public static string EncapsulateField = GettextCatalog.GetString ("Encapsulate field: '{0}' (but still use field)");
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs
index 67ec4bda54..a9a0652de2 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs
@@ -26,8 +26,7 @@
using System;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.CSharp.Formatting;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.CSharp.Completion
{
class AnonymousMethodCompletionData : RoslynCompletionData
@@ -50,16 +49,14 @@ namespace MonoDevelop.CSharp.Completion
return DisplayText.CompareTo(anonymousMethodCompletionData.DisplayText);
}
- public override async Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, Ide.Editor.Extension.KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Ide.Editor.Extension.KeyDescriptor descriptor)
{
- ka = await base.InsertCompletionText (window, 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);
- }
- return ka;
+ 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/CSharpCompletionTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
index 0f169a0da1..cfefd65b10 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
@@ -278,9 +278,9 @@ namespace MonoDevelop.CSharp.Completion
HandleDocumentParsed (null, null);
}
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
- var result = await base.KeyPress (descriptor);
+ bool result = base.KeyPress (descriptor);
if (/*EnableParameterInsight &&*/ (descriptor.KeyChar == ',' || descriptor.KeyChar == ')') && CanRunParameterCompletionCommand ())
base.RunParameterCompletionCommand ();
@@ -362,7 +362,7 @@ namespace MonoDevelop.CSharp.Completion
// timer.Dispose ();
} }
- class CSharpCompletionDataList : CompletionDataList
+ internal class CSharpCompletionDataList : CompletionDataList
{
}
@@ -372,7 +372,7 @@ namespace MonoDevelop.CSharp.Completion
}
- void AddImportCompletionData (CompletionResult completionResult, CSharpCompletionDataList result, RoslynCodeCompletionFactory factory, SemanticModel semanticModel, int position, CancellationToken cancellationToken = default(CancellationToken))
+ internal void AddImportCompletionData (CompletionResult completionResult, CSharpCompletionDataList result, RoslynCodeCompletionFactory factory, SemanticModel semanticModel, int position, CancellationToken cancellationToken = default(CancellationToken))
{
if (result.Count == 0)
return;
@@ -391,6 +391,9 @@ namespace MonoDevelop.CSharp.Completion
if (extensionMethodImport) {
var memberAccess = completionResult.SyntaxContext.TargetToken.Parent as MemberAccessExpressionSyntax;
if (memberAccess != null) {
+ var symbolInfo = completionResult.SyntaxContext.SemanticModel.GetSymbolInfo (memberAccess.Expression);
+ if (symbolInfo.Symbol.Kind == SymbolKind.NamedType)
+ return;
extensionType = completionResult.SyntaxContext.SemanticModel.GetTypeInfo (memberAccess.Expression).Type;
if (extensionType == null) {
return;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs
index fef480fbc0..91651bd413 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs
@@ -32,8 +32,7 @@ using System.Collections.Generic;
using System.Linq;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Ide.Editor.Extension;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.CSharp.Completion
{
class CastCompletionData : RoslynSymbolCompletionData
@@ -57,18 +56,16 @@ namespace MonoDevelop.CSharp.Completion
return "<span foreground=\"darkgray\">" + description + "</span>";
}
- public override async Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ 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 ()) {
- ka = await base.InsertCompletionText (window, ka, descriptor);
-
- var span = nodeToCast.Span;
- var type = SafeMinimalDisplayString (targetType, semanticModel, nodeToCast.SpanStart, Ambience.LabelFormat);
- editor.ReplaceText (span.Start, span.Length, "((" + type + ")" + nodeToCast + ")");
- }
- return ka;
+ 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)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs
index c46cf560a6..7b1cdb3456 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs
@@ -35,8 +35,7 @@ using MonoDevelop.Ide.Editor.Extension;
using MonoDevelop.CSharp.Refactoring;
using MonoDevelop.CSharp.Formatting;
using System;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.CSharp.Completion
{
class CreateOverrideCompletionData : RoslynSymbolCompletionData
@@ -94,7 +93,7 @@ namespace MonoDevelop.CSharp.Completion
this.GenerateBody = true;
}
- public override async Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
var editor = ext.Editor;
bool isExplicit = false;
@@ -143,8 +142,7 @@ namespace MonoDevelop.CSharp.Completion
editor.CaretOffset = targetCaretPosition;
}
- await OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
- return ka;
+ OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
}
public override bool IsOverload (CompletionData other)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs
index 743521944b..ea516a9ae7 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs
@@ -32,8 +32,7 @@ using MonoDevelop.CSharp.Refactoring;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Ide.Editor.Extension;
using System;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.CSharp.Completion
{
class CreatePartialCompletionData : RoslynSymbolCompletionData
@@ -90,7 +89,7 @@ namespace MonoDevelop.CSharp.Completion
this.GenerateBody = true;
}
- public override async Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
var editor = ext.Editor;
bool isExplicit = false;
@@ -132,9 +131,8 @@ namespace MonoDevelop.CSharp.Completion
editor.CaretOffset = targetCaretPosition;
}
- await OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
- editor.CaretLine--;
- return ka;
+ OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
+ editor.CaretLine--;
}
public override bool IsOverload (CompletionData other)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs
index 280a35dc34..47384b7952 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs
@@ -68,7 +68,7 @@ namespace MonoDevelop.CSharp.Completion
this.Icon = "md-newmethod";
}
- public override async Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
// insert add/remove event handler code after +=/-=
var editor = factory.Ext.Editor;
@@ -80,7 +80,7 @@ namespace MonoDevelop.CSharp.Completion
var document = IdeApp.Workbench.ActiveDocument;
- var parsedDocument = await document.UpdateParseDocument ();
+ var parsedDocument = document.UpdateParseDocument ().Result;
var semanticModel = parsedDocument.GetAst<SemanticModel> ();
var declaringType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol> (position, default(CancellationToken));
@@ -140,7 +140,7 @@ namespace MonoDevelop.CSharp.Completion
);
editor.StartInsertionMode (options);
- return ka;
+
}
public override bool IsOverload (CompletionData other)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs
index bed03c78a0..885eceb1af 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs
@@ -35,8 +35,7 @@ using MonoDevelop.Components.PropertyGrid.PropertyEditors;
using MonoDevelop.Ide.Editor;
using System.Text;
using ICSharpCode.NRefactory.MonoCSharp;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.CSharp.Completion
{
class ImportSymbolCompletionData : RoslynSymbolCompletionData
@@ -88,7 +87,7 @@ namespace MonoDevelop.CSharp.Completion
if (displayDescription == null) {
Initialize ();
if (generateUsing || insertNamespace) {
- displayDescription = string.Format (GettextCatalog.GetString ("(from '{0}')"), type.ContainingNamespace.Name);
+ displayDescription = string.Format (GettextCatalog.GetString ("(from '{0}')"), type.ContainingNamespace.GetFullName ());
} else {
displayDescription = "";
}
@@ -98,19 +97,19 @@ namespace MonoDevelop.CSharp.Completion
#region IActionCompletionData implementation
- public override async Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
{
Initialize ();
- var doc = completionExt.DocumentContext;
-
- ka = await base.InsertCompletionText (window, ka, descriptor);
- using (var undo = completionExt.Editor.OpenUndoGroup ()) {
- if (!window.WasShiftPressed && generateUsing) {
- AddGlobalNamespaceImport (completionExt.Editor, doc, type.ContainingNamespace.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat));
- }
- }
- ka |= KeyActions.Ignore;
- return ka;
+ 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)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
index d7b4fc55b3..2fa3acb6b4 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
@@ -33,8 +33,7 @@ using Microsoft.CodeAnalysis;
using MonoDevelop.CSharp.Refactoring;
using System.Linq;
using MonoDevelop.CSharp.Formatting;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.CSharp.Completion
{
class ProtocolCompletionData : RoslynSymbolCompletionData
@@ -131,7 +130,7 @@ namespace MonoDevelop.CSharp.Completion
this.GenerateBody = true;
}
- public override async Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
var editor = ext.Editor;
bool isExplicit = false;
@@ -180,8 +179,7 @@ namespace MonoDevelop.CSharp.Completion
editor.CaretOffset = targetCaretPosition;
}
- await OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
- return ka;
+ OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs
index 97da9f54f7..2a6095366f 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs
@@ -194,7 +194,7 @@ namespace MonoDevelop.CSharp.Completion
// return sig.GetKeywordTooltip (title, null);
// }
- public override Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
{
var currentWord = GetCurrentWord (window, descriptor);
var text = CompletionText;
@@ -204,7 +204,6 @@ namespace MonoDevelop.CSharp.Completion
text = text.Substring (1);
window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, currentWord, text);
- return Task.FromResult (ka);
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs
index 9e1c7aec40..6b0520948c 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs
@@ -175,7 +175,7 @@ namespace MonoDevelop.CSharp.Completion
});
}
- public override Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
{
string partialWord = GetCurrentWord (window, descriptor);
int skipChars = 0;
@@ -311,7 +311,6 @@ namespace MonoDevelop.CSharp.Completion
ext.RunCompletionCommand ();
});
}
- return Task.FromResult (ka);
}
static bool IsBracketAlreadyInserted (CSharpCompletionTextEditorExtension ext, IMethodSymbol method)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs
index a5e8616ce9..0053f925b9 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs
@@ -55,19 +55,13 @@ namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
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;
- });
+ col1.SetCellDataFunc (ct1, NameConventionRuleNameDataFunc);
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 ();
- });
+ col2.SetCellDataFunc (ct2, NameConventionRulePreviewDataFunc);
treeviewConventions.Model = treeStore;
treeviewConventions.Selection.Changed += HandleSelectionChanged;
@@ -79,6 +73,18 @@ namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
HandleSelectionChanged (null, null);
}
+ static void NameConventionRuleNameDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ var rule = (NameConventionRule)model.GetValue (iter, 0);
+ ((CellRendererText)cell).Text = rule.Name;
+ }
+
+ static void NameConventionRulePreviewDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ var rule = (NameConventionRule)model.GetValue (iter, 0);
+ ((CellRendererText)cell).Text = rule.GetPreview ();
+ }
+
void HandleSelectionChanged (object sender, EventArgs e)
{
TreeIter iter;
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
index 51587c77da..74edda34ae 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/DelegateCreationContextHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/DelegateCreationContextHandler.cs
@@ -86,14 +86,12 @@ namespace ICSharpCode.NRefactory6.CSharp.Completion
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;
@@ -109,16 +107,6 @@ namespace ICSharpCode.NRefactory6.CSharp.Completion
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;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
index df1c115eae..cbf4c1584d 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
@@ -696,7 +696,7 @@ namespace MonoDevelop.CSharp.Formatting
return info.GetValue (profile, null);
}
- static void RenderIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
+ static void RenderIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var pixbufCellRenderer = (CellRendererImage)cell;
if (model.IterHasChild (iter)) {
@@ -706,7 +706,7 @@ namespace MonoDevelop.CSharp.Formatting
}
}
- void ComboboxDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
+ static void ComboboxDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var cellRenderer = (CellRendererCombo)cell;
var info = GetProperty (model, iter);
@@ -714,17 +714,21 @@ namespace MonoDevelop.CSharp.Formatting
cellRenderer.Text = "<invalid>";
return;
}
+
+ var profile = ((CSharpFormattingProfileDialog)col.TreeView.Toplevel).profile;
object value = info.GetValue (profile, null);
cellRenderer.Text = value is Enum ? TranslateValue (value) : value.ToString ();
}
- void ToggleDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
+ static void ToggleDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var cellRenderer = (CellRendererToggle)cell;
var info = GetProperty (model, iter);
if (info == null || info.PropertyType != typeof(bool))
return;
+
+ var profile = ((CSharpFormattingProfileDialog)col.TreeView.Toplevel).profile;
bool value = (bool)info.GetValue (profile, null);
cellRenderer.Active = value;
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs
index 61b59d9dd9..83290e9f36 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs
@@ -45,7 +45,6 @@ using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Options;
using MonoDevelop.Refactoring;
-using System.Threading.Tasks;
namespace MonoDevelop.CSharp.Formatting
{
@@ -367,7 +366,7 @@ namespace MonoDevelop.CSharp.Formatting
}
}
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
completionWindowWasVisible = CompletionWindowManager.IsVisible;
cursorPositionBeforeKeyPress = Editor.CaretOffset;
@@ -383,7 +382,7 @@ namespace MonoDevelop.CSharp.Formatting
"SmartSemicolonPlacement",
false
) && !(stateTracker.IsInsideComment || stateTracker.IsInsideString)) {
- var retval = await base.KeyPress (descriptor);
+ 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))) {
@@ -394,13 +393,13 @@ namespace MonoDevelop.CSharp.Formatting
Editor.RemoveText (Editor.CaretOffset - 1, 1);
Editor.CaretOffset = guessedOffset;
lastInsertedSemicolon = Editor.CaretOffset + 1;
- retval = await base.KeyPress (descriptor);
+ retval = base.KeyPress (descriptor);
}
}
}
using (var undo = Editor.OpenUndoGroup ()) {
if (OnTheFlyFormatting && Editor != null && Editor.EditMode == EditMode.Edit) {
- await OnTheFlyFormatter.FormatStatmentAt (Editor, DocumentContext, Editor.CaretLocation, optionSet: optionSet);
+ OnTheFlyFormatter.FormatStatmentAt (Editor, DocumentContext, Editor.CaretLocation, optionSet: optionSet);
}
}
return retval;
@@ -428,7 +427,7 @@ namespace MonoDevelop.CSharp.Formatting
SafeUpdateIndentEngine (Editor.CaretOffset);
if (!stateTracker.IsInsideOrdinaryCommentOrString) {
if (descriptor.KeyChar == '@') {
- var retval = await base.KeyPress (descriptor);
+ var retval = base.KeyPress (descriptor);
int cursor = Editor.CaretOffset;
if (cursor < Editor.Length && Editor.GetCharAt (cursor) == '"')
ConvertNormalToVerbatimString (Editor, cursor + 1);
@@ -462,7 +461,7 @@ namespace MonoDevelop.CSharp.Formatting
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 = await base.KeyPress (descriptor);
+ retval = base.KeyPress (descriptor);
//handle inserted characters
@@ -516,7 +515,7 @@ namespace MonoDevelop.CSharp.Formatting
}
}
- await HandleOnTheFlyFormatting (descriptor);
+ HandleOnTheFlyFormatting (descriptor);
SafeUpdateIndentEngine (Editor.CaretOffset);
lastCharInserted = '\0';
CheckXmlCommentCloseTag (descriptor.KeyChar);
@@ -524,7 +523,7 @@ namespace MonoDevelop.CSharp.Formatting
}
if (Editor.Options.IndentStyle == IndentStyle.Auto && DefaultSourceEditorOptions.Instance.TabIsReindent && descriptor.SpecialKey == SpecialKey.Tab) {
- bool retval = await base.KeyPress (descriptor);
+ bool retval = base.KeyPress (descriptor);
DoReSmartIndent ();
CheckXmlCommentCloseTag (descriptor.KeyChar);
return retval;
@@ -532,7 +531,7 @@ namespace MonoDevelop.CSharp.Formatting
//pass through to the base class, which actually inserts the character
//and calls HandleCodeCompletion etc to handles completion
- var result = await base.KeyPress (descriptor);
+ var result = base.KeyPress (descriptor);
if (!indentationDisabled && (descriptor.SpecialKey == SpecialKey.Return)) {
DoReSmartIndent ();
@@ -540,12 +539,12 @@ namespace MonoDevelop.CSharp.Formatting
CheckXmlCommentCloseTag (descriptor.KeyChar);
- await HandleOnTheFlyFormatting (descriptor);
+ HandleOnTheFlyFormatting (descriptor);
return result;
}
- async Task HandleOnTheFlyFormatting (KeyDescriptor descriptor)
+ void HandleOnTheFlyFormatting (KeyDescriptor descriptor)
{
if (descriptor.KeyChar == '{')
return;
@@ -566,7 +565,7 @@ namespace MonoDevelop.CSharp.Formatting
return;
using (var undo = Editor.OpenUndoGroup ()) {
if (OnTheFlyFormatting && Editor != null && Editor.EditMode == EditMode.Edit) {
- await OnTheFlyFormatter.FormatStatmentAt (Editor, DocumentContext, Editor.CaretLocation, optionSet: optionSet);
+ OnTheFlyFormatter.FormatStatmentAt (Editor, DocumentContext, Editor.CaretLocation, optionSet: optionSet);
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
index 218be22afa..049c9906fd 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
@@ -39,33 +39,32 @@ using Microsoft.CodeAnalysis.Text;
using MonoDevelop.Ide.Gui.Content;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Options;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.CSharp.Formatting
{
static class OnTheFlyFormatter
{
- public static Task Format (TextEditor editor, DocumentContext context)
+ public static void Format (TextEditor editor, DocumentContext context)
{
- return Format (editor, context, 0, editor.Length);
+ Format (editor, context, 0, editor.Length);
}
- public static Task Format (TextEditor editor, DocumentContext context, int startOffset, int endOffset, bool exact = true, OptionSet optionSet = null)
+ public static void Format (TextEditor editor, DocumentContext context, int startOffset, int endOffset, bool exact = true, OptionSet optionSet = null)
{
var policyParent = context.Project != null ? context.Project.Policies : PolicyService.DefaultPolicies;
var mimeTypeChain = DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
- return Format (policyParent, mimeTypeChain, editor, context, startOffset, endOffset, exact, optionSet: optionSet);
+ Format (policyParent, mimeTypeChain, editor, context, startOffset, endOffset, exact, optionSet: optionSet);
}
- public static Task FormatStatmentAt (TextEditor editor, DocumentContext context, MonoDevelop.Ide.Editor.DocumentLocation location, OptionSet optionSet = null)
+ public static void FormatStatmentAt (TextEditor editor, DocumentContext context, MonoDevelop.Ide.Editor.DocumentLocation location, OptionSet optionSet = null)
{
var offset = editor.LocationToOffset (location);
var policyParent = context.Project != null ? context.Project.Policies : PolicyService.DefaultPolicies;
var mimeTypeChain = DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
- return Format (policyParent, mimeTypeChain, editor, context, offset, offset, false, true, optionSet: optionSet);
+ Format (policyParent, mimeTypeChain, editor, context, offset, offset, false, true, optionSet: optionSet);
}
- static async Task Format (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, TextEditor editor, DocumentContext context, int startOffset, int endOffset, bool exact, bool formatLastStatementOnly = false, OptionSet optionSet = null)
+ static void Format (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, TextEditor editor, DocumentContext context, int startOffset, int endOffset, bool exact, bool formatLastStatementOnly = false, OptionSet optionSet = null)
{
TextSpan span;
if (exact) {
@@ -100,8 +99,8 @@ namespace MonoDevelop.CSharp.Formatting
optionSet = policy.CreateOptions (textPolicy);
}
- var doc = await Formatter.FormatAsync (analysisDocument, span, optionSet);
- var newTree = await doc.GetSyntaxTreeAsync ();
+ var doc = Formatter.FormatAsync (analysisDocument, span, optionSet).Result;
+ var newTree = doc.GetSyntaxTreeAsync ().Result;
var caretOffset = editor.CaretOffset;
int delta = 0;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs
index 8024897ab8..e7b2bde6aa 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs
@@ -48,8 +48,15 @@ namespace MonoDevelop.CSharp.Navigation
using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
var foundSymbol = sym.OverriddenMember ();
while (foundSymbol != null) {
- foreach (var loc in foundSymbol.Locations)
+ foreach (var loc in foundSymbol.Locations) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
+ if (loc.SourceTree == null)
+ continue;
+
monitor.ReportResult (new MemberReference (foundSymbol, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
foundSymbol = foundSymbol.OverriddenMember ();
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs
index 44e0cded3a..e6ca8cef4c 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs
@@ -69,24 +69,29 @@ namespace MonoDevelop.CSharp.Refactoring
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)
- );
+ try {
+ if (symbol.ContainingType != null && symbol.ContainingType.TypeKind == TypeKind.Interface) {
+ result = await SymbolFinder.FindImplementationsAsync (symbol, TypeSystemService.Workspace.CurrentSolution, cancellationToken: monitor.CancellationToken).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, cancellationToken: monitor.CancellationToken).ConfigureAwait (false)).Cast<ISymbol> ().Concat (
+ await FindInterfaceImplementaitonsAsync (type, TypeSystemService.Workspace.CurrentSolution, monitor.CancellationToken).ConfigureAwait (false)
+ );
+ } else {
+ result = (await SymbolFinder.FindDerivedClassesAsync (type, TypeSystemService.Workspace.CurrentSolution, cancellationToken: monitor.CancellationToken).ConfigureAwait (false)).Cast<ISymbol> ();
+ }
} else {
- result = (await SymbolFinder.FindDerivedClassesAsync (type, TypeSystemService.Workspace.CurrentSolution).ConfigureAwait (false)).Cast<ISymbol> ();
+ result = await SymbolFinder.FindOverridesAsync (symbol, TypeSystemService.Workspace.CurrentSolution, cancellationToken: monitor.CancellationToken).ConfigureAwait (false);
}
- } 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));
+ foreach (var foundSymbol in result) {
+ foreach (var loc in foundSymbol.Locations) {
+ monitor.CancellationToken.ThrowIfCancellationRequested ();
+ monitor.ReportResult (new MemberReference (foundSymbol, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
+ }
+ } catch (OperationCanceledException) {
}
}
});
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs
index e759081e67..4091082d63 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs
@@ -72,11 +72,14 @@ namespace MonoDevelop.CSharp.Navigation
if (symType == null)
return;
using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
- foreach (var type in compilation.Assembly.GlobalNamespace.GetAllTypes ()) {
+ foreach (var type in compilation.Assembly.GlobalNamespace.GetAllTypes (monitor.CancellationToken)) {
if (!type.MightContainExtensionMethods)
continue;
foreach (var extMethod in type.GetMembers ().OfType<IMethodSymbol> ().Where (method => method.IsExtensionMethod)) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ break;
+
var reducedMethod = extMethod.ReduceExtensionMethod (symType);
if (reducedMethod != null) {
var loc = extMethod.Locations.First ();
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs
index d8830eed5f..c37c5a4362 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs
@@ -80,6 +80,8 @@ namespace MonoDevelop.CSharp.Navigation
if (implementingType == null)
return;
foreach (var interfaceMember in interfaceType.GetMembers ()) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
var impl = implementingType.FindImplementationForInterfaceMember (interfaceMember);
if (impl == null)
continue;
@@ -89,6 +91,9 @@ namespace MonoDevelop.CSharp.Navigation
foreach (var iFace in interfaceType.AllInterfaces) {
foreach (var interfaceMember in iFace.GetMembers ()) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
var impl = implementingType.FindImplementationForInterfaceMember (interfaceMember);
if (impl == null)
continue;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs
index 3b4dd9fbae..40790bf58c 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs
@@ -58,14 +58,22 @@ namespace MonoDevelop.CSharp.Navigation
switch (symbol.Kind) {
case SymbolKind.Method:
foreach (var method in symbol.ContainingType.GetMembers (symbol.Name).OfType<IMethodSymbol> ()) {
- foreach (var loc in method.Locations)
+ foreach (var loc in method.Locations) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
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)
+ foreach (var loc in property.Locations) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
monitor.ReportResult (new MemberReference (property, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
}
break;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs
index 82d6abfd9c..c1bff90270 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs
@@ -35,10 +35,12 @@ using System.Collections.Generic;
using MonoDevelop.CSharp.Formatting;
using Microsoft.CodeAnalysis.Options;
using MonoDevelop.CSharp.Completion;
+using System.Threading;
+using ICSharpCode.NRefactory;
namespace MonoDevelop.CSharp.Refactoring
{
- class CSharpCodeGenerator // : CodeGenerator
+ class CSharpCodeGenerator : CodeGenerator
{
// static CSharpAmbience ambience = new CSharpAmbience ();
//
@@ -121,19 +123,19 @@ namespace MonoDevelop.CSharp.Refactoring
sb.AppendLine();
}
- // public override string WrapInRegions (string regionName, string text)
- // {
- // StringBuilder result = new StringBuilder ();
- // AppendIndent (result);
- // result.Append ("#region ");
- // result.Append (regionName);
- // AppendLine (result);
- // result.Append (text);
- // AppendLine (result);
- // AppendIndent (result);
- // result.Append ("#endregion");
- // return result.ToString ();
- // }
+ public override string WrapInRegions (string regionName, string text)
+ {
+ StringBuilder result = new StringBuilder ();
+ AppendIndent (result);
+ result.Append ("#region ");
+ result.Append (regionName);
+ AppendLine (result);
+ result.Append (text);
+ AppendLine (result);
+ AppendIndent (result);
+ result.Append ("#endregion");
+ return result.ToString ();
+ }
static void AppendObsoleteAttribute(StringBuilder result, CodeGenerationOptions options, ISymbol entity)
{
@@ -328,8 +330,8 @@ namespace MonoDevelop.CSharp.Refactoring
{
if (type == null)
throw new ArgumentNullException("type");
- result.Append(RoslynCompletionData.SafeMinimalDisplayString (type, options.SemanticModel, options.Part.SourceSpan.Start, Ambience.LabelFormat));
-
+ result.Append(RoslynCompletionData.SafeMinimalDisplayString (type, options.SemanticModel, options.Part.SourceSpan.Start, Ambience.LabelFormat));
+
// var implementingType = options.Part;
// var loc = implementingType.Region.End;
//
@@ -783,7 +785,7 @@ namespace MonoDevelop.CSharp.Refactoring
result.Append (GetModifiers (options.ImplementingType, options.Part, member));
//bool isFromInterface = false;
if (member.ContainingType != null && member.ContainingType.TypeKind == TypeKind.Interface) {
- //isFromInterface = true;
+ //isFromInterface = true;
// TODO: Type system conversion.
// if (options.ImplementingType != null) {
// foreach (var type in options.ImplementingType.BaseTypes) {
@@ -1000,19 +1002,16 @@ namespace MonoDevelop.CSharp.Refactoring
// var builder = new ICSharpCode.NRefactory.CSharp.Refactoring.TypeSystemAstBuilder (csResolver);
// return builder.ConvertType (fullType);
// }
- //
- // public override void CompleteStatement (MonoDevelop.Ide.Gui.Document doc)
- // {
- // // TODO: BROKEN DUE ROSLYN PORT - needs to be ported to NR6
- //// var fixer = new ConstructFixer (doc.GetFormattingOptions (), doc.Editor.CreateNRefactoryTextEditorOptions ());
- //// int newOffset;
- //// if (fixer.TryFix (new DocumentWrapper (doc.Editor), doc.Editor.CaretOffset, out newOffset)) {
- //// doc.Editor.CaretOffset = newOffset;
- //// }
- // }
-
-
+ //
+ public override async void CompleteStatement (MonoDevelop.Ide.Gui.Document doc)
+ {
+ var fixer = new ConstructFixer (doc.GetFormattingOptions ());
+ int newOffset = await fixer.TryFix (doc, doc.Editor.CaretOffset, default(CancellationToken));
+ if (newOffset != -1) {
+ doc.Editor.CaretOffset = newOffset;
+ }
+ }
static CodeGeneratorMemberResult GenerateProtocolCode(IMethodSymbol method, CodeGenerationOptions options)
{
@@ -1061,5 +1060,14 @@ namespace MonoDevelop.CSharp.Refactoring
return new CodeGeneratorMemberResult(result.ToString (), bodyStartOffset, bodyEndOffset);
}
+ public override void AddGlobalNamespaceImport (TextEditor editor, DocumentContext context, string nsName)
+ {
+ // not used anymore
+ }
+
+ public override void AddLocalNamespaceImport (TextEditor editor, DocumentContext context, string nsName, TextLocation caretLocation)
+ {
+ // 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
index 59df3df062..70565d2232 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFeaturesTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFeaturesTextEditorExtension.cs
@@ -70,8 +70,12 @@ namespace MonoDevelop.CSharp.Refactoring
GoToDefinitionService.DisplayMultiple = delegate (IEnumerable<Tuple<Solution, ISymbol, Location>> list) {
using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
- foreach (var part in list)
+ foreach (var part in list) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
monitor.ReportResult (GotoDeclarationHandler.GetJumpTypePartSearchResult (part.Item2, part.Item3));
+ }
}
};
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs
index 9ccbbe49af..f3a3c3c483 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs
@@ -206,6 +206,9 @@ namespace MonoDevelop.CSharp.Refactoring
}
foreach (var loc in lookup.Symbol.Locations) {
+ if (token.IsCancellationRequested)
+ break;
+
if (!loc.IsInSource)
continue;
var fileName = loc.SourceTree.FilePath;
@@ -223,6 +226,8 @@ namespace MonoDevelop.CSharp.Refactoring
foreach (var mref in await SymbolFinder.FindReferencesAsync (lookup.Symbol, lookup.Solution).ConfigureAwait (false)) {
foreach (var loc in mref.Locations) {
+ if (token.IsCancellationRequested)
+ break;
var fileName = loc.Document.FilePath;
var offset = loc.Location.SourceSpan.Start;
string projectedName;
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/FindProjectReferenceUsagesHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindProjectReferenceUsagesHandler.cs
index 1c3bcf9f18..53727a8f74 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindProjectReferenceUsagesHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindProjectReferenceUsagesHandler.cs
@@ -81,27 +81,39 @@ namespace MonoDevelop.CSharp.Refactoring
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))
+ try {
+ var model = await document.GetSemanticModelAsync (monitor.CancellationToken).ConfigureAwait (false);
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
+ var root = await model.SyntaxTree.GetRootAsync (monitor.CancellationToken).ConfigureAwait (false);
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
+ root.DescendantNodes (node => {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return false;
+
+ 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;
}
- monitor.ReportResult (new MemberReference (info.Symbol, document.FilePath, node.Span.Start, node.Span.Length));
- return false;
- }
- return true;
- }).Count ();
- monitor.Step ();
+ return true;
+ }).Count ();
+ } finally {
+ monitor.Step ();
+ }
});
monitor.EndTask ();
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs
index bbd792a985..10a67bc9cf 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs
@@ -55,6 +55,9 @@ namespace MonoDevelop.CSharp.Refactoring
try {
var antiDuplicatesSet = new HashSet<SearchResult> (new SearchResultComparer ());
foreach (var loc in symbol.Locations) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
if (!loc.IsInSource)
continue;
var fileName = loc.SourceTree.FilePath;
@@ -70,8 +73,10 @@ namespace MonoDevelop.CSharp.Refactoring
monitor.ReportResult (sr);
}
- foreach (var mref in await SymbolFinder.FindReferencesAsync (symbol, solution).ConfigureAwait (false)) {
+ foreach (var mref in await SymbolFinder.FindReferencesAsync (symbol, solution, monitor.CancellationToken).ConfigureAwait (false)) {
foreach (var loc in mref.Locations) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
var fileName = loc.Document.FilePath;
var offset = loc.Location.SourceSpan.Start;
string projectedName;
@@ -86,6 +91,7 @@ namespace MonoDevelop.CSharp.Refactoring
}
}
}
+ } catch (OperationCanceledException) {
} catch (Exception ex) {
if (monitor != null)
monitor.ReportError ("Error finding references", ex);
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs
index 7ca54c08f6..40a1d0b158 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs
@@ -49,7 +49,7 @@ namespace MonoDevelop.CSharp.Refactoring
{
var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (location.SourceTree.FilePath);
var doc = TextEditorFactory.CreateNewDocument ();
- doc.Text = provider.ReadString ();
+ doc.Text = provider.ReadString ().ReadToEnd ();
int position = location.SourceSpan.Start;
while (position + part.Name.Length < doc.Length) {
if (doc.GetTextAt (position, part.Name.Length) == part.Name)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs
index 078ad4dc1b..ff091978dd 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs
@@ -38,6 +38,7 @@ 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
{
@@ -155,6 +156,7 @@ namespace MonoDevelop.CSharp
test.UnitTestIdentifier = GetFullName (parentClass) + "." + method.Name;
foundTests.Add (test);
}
+ break;
}
}
if (test != null) {
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs
index 57bf692a05..901ac3677b 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs
@@ -47,17 +47,19 @@ namespace MonoDevelop.CSharp
{
var parsedDocument = DocumentContext.ParsedDocument;
if (parsedDocument == null)
- return emptyList;
+ return Enumerable.Empty<NavigationSegment> ();
var model = parsedDocument.GetAst<SemanticModel> ();
if (model == null)
- return emptyList;
- try {
- var visitor = new NavigationVisitor (DocumentContext, model, new TextSpan (offset, length), token);
- visitor.Visit (await model.SyntaxTree.GetRootAsync (token).ConfigureAwait (false));
- return visitor.result;
- } catch (OperationCanceledException) {
- return emptyList;
- }
+ 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
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs
index 89cd40ade2..a89341c298 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs
@@ -78,8 +78,8 @@ namespace MonoDevelop.CSharp
{
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);
+ if (!this.colorStyle.FitsIdeTheme (Ide.IdeApp.Preferences.UserInterfaceTheme))
+ this.colorStyle = SyntaxModeService.GetDefaultColorStyle (Ide.IdeApp.Preferences.UserInterfaceTheme);
this.ctx = ctx;
if (ctx != null) {
this.options = ctx.GetOptionSet ();
@@ -459,7 +459,7 @@ namespace MonoDevelop.CSharp
if (t == null)
throw new ArgumentNullException ("t");
if (t.TypeKind == TypeKind.Error)
- return "Type can not be resolved.";
+ return GettextCatalog.GetString ("Type can not be resolved.");
if (t.TypeKind == TypeKind.Delegate)
return GetDelegateMarkup ((INamedTypeSymbol)t);
if (t.TypeKind == TypeKind.TypeParameter)
@@ -967,125 +967,104 @@ namespace MonoDevelop.CSharp
var color = AlphaBlend (colorStyle.PlainText.Foreground, colorStyle.PlainText.Background, optionalAlpha);
var colorString = MonoDevelop.Components.HelperMethods.GetColorString (color);
- var keywordSign = "<span foreground=\"" + colorString + "\">" + " (keyword)</span>";
+ var keywordSign = "<span foreground=\"" + colorString + "\"> " + GettextCatalog.GetString ("(keyword)") + "</span>";
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} modifier can be used with classes, methods, properties, indexers, and events.", Highlight ("abstract", colorStyle.KeywordModifiers));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[modifiers] {0} {{ accessor-body }}", Highlight ("add", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to define a custom accessor for when an event is subscribed to. If supplied, a remove accessor must also be supplied.", Highlight ("add", colorStyle.KeywordContext));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"), GettextCatalog.GetString ("{0} ordering-statement {1}", Highlight ("orderby", colorStyle.KeywordContext), Highlight ("ascending", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to set the sorting order from smallest to largest in a query expression. This is the default behaviour.", Highlight ("ascending", colorStyle.KeywordContext));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} modifier is used to specify that a class method, anonymous method, or lambda expression is asynchronous.", Highlight ("async", colorStyle.KeywordContext));
break;
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. ";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("expression {0} type", Highlight ("as", colorStyle.KeywordOperators)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} operator is used to perform conversions between compatible types.", Highlight ("as", colorStyle.KeywordOperators));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} operator is used to specify that an {1} method is to have its execution suspended until the {0} task has completed.", Highlight ("await", colorStyle.KeywordContext), Highlight ("async", colorStyle.KeywordContext));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to access members of the base class from within a derived class.", Highlight ("base", colorStyle.KeywordAccessors));
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), Highlight ("break", colorStyle.KeywordJump) + ";");
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement terminates the closest enclosing loop or switch statement in which it appears.", Highlight ("break", colorStyle.KeywordJump));
break;
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.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} constant-expression:\n statement\n jump-statement", Highlight ("case", colorStyle.KeywordSelection)));
result.SummaryMarkup = "";
break;
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 +
- " " + Highlight ("catch", colorStyle.KeywordException) + " (exception-declaration-2) catch-block-2" + Environment.NewLine +
- " ..." + Environment.NewLine +
- Highlight ("try", colorStyle.KeywordException) + " try-block " + Highlight ("catch", colorStyle.KeywordException) + " catch-block");
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} try-block\n {1} (exception-declaration-1) catch-block-1\n {1} (exception-declaration-2) catch-block-2\n ...\n{0} try-block {1} catch-block", Highlight ("try", colorStyle.KeywordException), Highlight ("catch", colorStyle.KeywordException)));
result.SummaryMarkup = "";
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} block\nor\n{0} (expression)", Highlight ("checked", colorStyle.KeywordOther)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("checked", colorStyle.KeywordOther));
break;
case SyntaxKind.ClassKeyword:
result.SignatureMarkup = Highlight ("class", colorStyle.KeywordDeclaration) + keywordSign;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} constraint specifies that the type argument must be a reference type; this applies also to any class, interface, delegate, or array type.", Highlight ("class", colorStyle.KeywordDeclaration));
} 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) + ".";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[attributes] [modifiers] {0} identifier [:base-list] {{ class-body }}[;]", Highlight ("class", colorStyle.KeywordDeclaration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("Classes are declared using the keyword {0}.", Highlight ("class", colorStyle.KeywordDeclaration));
}
break;
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. ";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[attributes] [modifiers] {0} type declarators;", Highlight ("const", colorStyle.KeywordModifiers)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("const", colorStyle.KeywordModifiers));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), Highlight ("continue", colorStyle.KeywordJump) + ";");
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement passes control to the next iteration of the enclosing iteration statement in which it appears.", Highlight ("continue", colorStyle.KeywordJump));
break;
case SyntaxKind.DefaultKeyword:
result.SignatureMarkup = Highlight ("default", colorStyle.KeywordSelection) + keywordSign;
result.SummaryMarkup = "";
if (node.Parent != null) {
if (node.Parent is DefaultExpressionSyntax) {
- result.AddCategory ("Form",
- Highlight ("default", colorStyle.KeywordSelection) + " (Type)");
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} (Type)", Highlight ("default", colorStyle.KeywordSelection)));
break;
} else if (node.Parent is SwitchStatementSyntax) {
- result.AddCategory ("Form",
- 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 +
- "}");
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} (expression) { \n {1} constant-expression:\n statement\n jump-statement\n [{2}:\n statement\n jump-statement]\n}",
+ Highlight ("switch", colorStyle.KeywordSelection), Highlight ("case", colorStyle.KeywordSelection), Highlight ("default", colorStyle.KeywordSelection)));
break;
}
}
- result.AddCategory ("Form",
- Highlight ("default", colorStyle.KeywordSelection) + " (Type)" + 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 +
- "}");
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} (Type)\n\nor\n\n{1} (expression) { \n {2} constant-expression:\n statement\n jump-statement\n [{3}:\n statement\n jump-statement]\n}",
+ Highlight ("default", colorStyle.KeywordSelection), Highlight ("switch", colorStyle.KeywordSelection), Highlight ("case", colorStyle.KeywordSelection), Highlight ("default", colorStyle.KeywordSelection))
+ );
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[attributes] [modifiers] {0} result-type identifier ([formal-parameters]);", Highlight ("delegate", colorStyle.KeywordDeclaration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("A {0} declaration defines a reference type that can be used to encapsulate a method with a specific signature.", Highlight ("delegate", colorStyle.KeywordDeclaration));
break;
case SyntaxKind.IdentifierToken:
if (node.ToFullString () == "nameof" && node.Parent?.Parent?.Kind () == SyntaxKind.InvocationExpression)
@@ -1093,380 +1072,351 @@ namespace MonoDevelop.CSharp
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} type allows for an object to bypass compile-time type checking and resolve type checking during run-time.", Highlight ("dynamic", colorStyle.KeywordContext));
} else {
return null;
}
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"), GettextCatalog.GetString ("{0} ordering-statement {1}", Highlight ("orderby", colorStyle.KeywordContext), Highlight ("descending", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to set the sorting order from largest to smallest in a query expression.", Highlight ("descending", colorStyle.KeywordContext));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} statement {1} (expression);", Highlight ("do", colorStyle.KeywordIteration), Highlight ("while", colorStyle.KeywordIteration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement executes a statement or a block of statements repeatedly until a specified expression evaluates to false.", Highlight ("do", colorStyle.KeywordIteration));
break;
case SyntaxKind.ElseKeyword:
result.SignatureMarkup = Highlight ("else", colorStyle.KeywordSelection) + keywordSign;
- result.AddCategory ("Form", Highlight ("if", colorStyle.KeywordSelection) + " (expression)" + Environment.NewLine +
- " statement1" + Environment.NewLine +
- " [" + Highlight ("else", colorStyle.KeywordSelection) + Environment.NewLine +
- " statement2]");
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} (expression)\n statement1\n [{1}\n statement2]", Highlight ("if", colorStyle.KeywordSelection), Highlight ("else", colorStyle.KeywordSelection)));
result.SummaryMarkup = "";
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[attributes] [modifiers] {0} identifier [:base-type] {{ enumerator-list }} [;]", Highlight ("enum", colorStyle.KeywordDeclaration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to declare an enumeration, a distinct type consisting of a set of named constants called the enumerator list.", Highlight ("enum", colorStyle.KeywordDeclaration));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[attributes] [modifiers] {0} type declarator;\n[attributes] [modifiers] {0} type member-name {{ accessor-declarations }};", Highlight ("event", colorStyle.KeywordModifiers)));
+ result.SummaryMarkup = GettextCatalog.GetString ("Specifies an event.");
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to declare an explicit user-defined type conversion operator.", Highlight ("explicit", colorStyle.KeywordOperatorDeclaration));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("Use the {0} 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.", Highlight ("extern", colorStyle.KeywordModifiers));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} try-block {1} finally-block",Highlight ("try", colorStyle.KeywordException), Highlight ("finally", colorStyle.KeywordException)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("finally", colorStyle.KeywordException));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} ( type* ptr = expr ) statement", Highlight ("fixed", colorStyle.KeywordOther)));
+ result.SummaryMarkup = GettextCatalog.GetString ("Prevents relocation of a variable by the garbage collector.");
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} ([initializers]; [expression]; [iterators]) statement", Highlight ("for", colorStyle.KeywordIteration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} loop executes a statement or a block of statements repeatedly until a specified expression evaluates to false.", Highlight ("for", colorStyle.KeywordIteration));
break;
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. ";
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} (type identifier {1} expression) statement", Highlight ("foreach", colorStyle.KeywordIteration), Highlight ("in", colorStyle.KeywordIteration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement repeats a group of embedded statements for each element in an array or an object collection.", Highlight ("foreach", colorStyle.KeywordIteration));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} range-variable {1} data-source [query clauses] {2} product-expression", Highlight ("from", colorStyle.KeywordContext), Highlight ("in", colorStyle.KeywordIteration), Highlight ("select", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword marks the beginning of a query expression and defines the data source and local variable to represent the elements in the sequence.", Highlight ("from", colorStyle.KeywordContext));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[modifiers] {0} [ {{ accessor-body }} ]", Highlight ("get", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to define an accessor method to retrieve the value of the property or indexer element.", Highlight ("get", colorStyle.KeywordContext));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} :: type", Highlight ("global", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to specify a type is within the global namespace.", Highlight ("global", colorStyle.KeywordContext));
break;
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. ";
+ result.AddCategory (
+ GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} identifier;\n{0} {1} constant-expression;\n {0} {2};", Highlight ("goto", colorStyle.KeywordJump), Highlight ("case", colorStyle.KeywordSelection), Highlight ("default", colorStyle.KeywordSelection)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement transfers the program control directly to a labeled statement. ", Highlight ("goto", colorStyle.KeywordJump));
break;
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 +
- Highlight ("group", colorStyle.KeywordContext) + " range-variable " + Highlight ("by", colorStyle.KeywordContext) + " key-value " + Highlight ("into", colorStyle.KeywordContext) + " group-name ");
- 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'.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"),
+ GettextCatalog.GetString ("{0} range-variable {1} key-value\n\nor\n\n{2} range-variable {1} key-value {3} group-name ", Highlight ("group", colorStyle.KeywordContext), Highlight ("by", colorStyle.KeywordContext), Highlight ("group", colorStyle.KeywordContext), Highlight ("into", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword groups elements together from a query which match the key value and stores the result in an {1}. It can also be stored in a group for further use in the query with 'into'.", Highlight ("group", colorStyle.KeywordContext), Highlight ("IGrouping&lt;TKey, TElement&gt;", colorStyle.KeywordTypes));
break;
case SyntaxKind.IfKeyword:
result.SignatureMarkup = Highlight ("if", colorStyle.KeywordSelection) + keywordSign;
- result.AddCategory ("Form", Highlight ("if", colorStyle.KeywordSelection) + " (expression)" + Environment.NewLine +
- " statement1" + Environment.NewLine +
- " [" + Highlight ("else", colorStyle.KeywordSelection) + Environment.NewLine +
- " statement2]");
- result.SummaryMarkup = "The " + Highlight ("if", colorStyle.KeywordSelection) + " statement selects a statement for execution based on the value of a Boolean expression. ";
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} (expression)\n statement1\n [{1}\n statement2]", Highlight ("if", colorStyle.KeywordSelection), Highlight ("else", colorStyle.KeywordSelection)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement selects a statement for execution based on the value of a Boolean expression.", Highlight ("if", colorStyle.KeywordSelection));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"), GettextCatalog.GetString ("{0} range-variable {1} key-value {2} group-name ", Highlight ("group", colorStyle.KeywordContext), Highlight ("by", colorStyle.KeywordContext), Highlight ("into", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword stores the result of a group statement for further use in the query.", Highlight ("into", colorStyle.KeywordContext));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to declare an implicit user-defined type conversion operator.", Highlight ("implicit", colorStyle.KeywordOperatorDeclaration));
break;
case SyntaxKind.InKeyword:
result.SignatureMarkup = Highlight ("in", colorStyle.KeywordIteration) + keywordSign;
if (node.Parent != null) {
if (node.Parent is ForEachStatementSyntax) {
- result.AddCategory ("Form",
- Highlight ("foreach", colorStyle.KeywordIteration) + " (type identifier " + Highlight ("in", colorStyle.KeywordIteration) + " expression) statement");
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} (type identifier {1} expression) statement", Highlight ("foreach", colorStyle.KeywordIteration), Highlight ("in", colorStyle.KeywordIteration)));
break;
}
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");
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} range-variable {1} data-source [query clauses] {2} product-expression", Highlight ("from", colorStyle.KeywordContext), Highlight ("in", colorStyle.KeywordIteration), Highlight ("select", colorStyle.KeywordContext)));
break;
}
if (node.Parent is TypeParameterConstraintClauseSyntax) {
- result.AddCategory ("Form",
- Highlight ("interface", colorStyle.KeywordDeclaration) + " IMyInterface&lt;" + Highlight ("in", colorStyle.KeywordIteration) + " T&gt; {}");
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} IMyInterface&lt; {1} T&gt; {}", Highlight ("interface", colorStyle.KeywordDeclaration), Highlight ("in", colorStyle.KeywordIteration)));
break;
}
}
- result.AddCategory ("Form", Highlight ("foreach", colorStyle.KeywordIteration) + " (type identifier " + Highlight ("in", colorStyle.KeywordIteration) + " expression) statement" + Environment.NewLine + Environment.NewLine +
- "or" + Environment.NewLine + Environment.NewLine +
- Highlight ("from", colorStyle.KeywordContext) + " range-variable " + Highlight ("in", colorStyle.KeywordIteration) + " data-source [query clauses] " + Highlight ("select", colorStyle.KeywordContext) + " product-expression" + Environment.NewLine + Environment.NewLine +
- "or" + Environment.NewLine + Environment.NewLine +
- Highlight ("interface", colorStyle.KeywordDeclaration) + " IMyInterface&lt;" + Highlight ("in", colorStyle.KeywordIteration) + " T&gt; {}"
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} (type identifier {1} expression) statement\n\nor\n\n{0} range-variable {1} data-source [query clauses] {2} product-expression\n\nor\n\n{3} IMyInterface&lt;{1} T&gt; {{}}",
+ Highlight ("foreach", colorStyle.KeywordIteration), Highlight ("in", colorStyle.KeywordIteration), Highlight ("select", colorStyle.KeywordContext), Highlight ("interface", colorStyle.KeywordDeclaration))
);
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[attributes] [modifiers] {0} identifier [:base-list] {{interface-body}}[;]", Highlight ("interface", colorStyle.KeywordDeclaration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("An interface defines a contract. A class or struct that implements an interface must adhere to its contract.");
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is an access modifier for types and type members. Internal members are accessible only within files in the same assembly.", Highlight ("internal", colorStyle.KeywordModifiers));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("expression {0} type", Highlight ("is", colorStyle.KeywordOperators)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} operator is used to check whether the run-time type of an object is compatible with a given type.", Highlight ("is", colorStyle.KeywordOperators));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"), GettextCatalog.GetString ("{0} range-variable2 {1} range2 {2} statement1 {3} statement2 [ {4} group-name ]",
+ Highlight ("join", colorStyle.KeywordContext), Highlight ("in", colorStyle.KeywordContext), Highlight ("on", colorStyle.KeywordContext), Highlight ("equals", colorStyle.KeywordContext), Highlight ("into", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} clause produces a new sequence of elements from two source sequences on a given equality condition.", Highlight ("join", colorStyle.KeywordContext));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"), GettextCatalog.GetString ("{0} range-variable = expression", Highlight ("let", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} clause allows for a sub-expression to have its value stored in a new range variable for use later in the query.", Highlight ("let", colorStyle.KeywordContext));
break;
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. ";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} (expression) statement_block", Highlight ("lock", colorStyle.KeywordOther)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("lock", colorStyle.KeywordOther));
break;
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. ";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} name[.name1] ...] {{\ntype-declarations\n }}", Highlight ("namespace", colorStyle.KeywordNamespace)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to declare a scope.", Highlight ("namespace", colorStyle.KeywordNamespace));
break;
case SyntaxKind.NewKeyword:
result.SignatureMarkup = Highlight ("new", colorStyle.KeywordOperators) + keywordSign;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("new", colorStyle.KeywordOperators));
} 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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("new", colorStyle.KeywordOperators));
}
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is a literal that represents a null reference, one that does not refer to any object. {0} is the default value of reference-type variables.", Highlight ("null", colorStyle.KeywordConstants));
break;
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 +
- "op-type operand," + Environment.NewLine +
- "op-type2 operand2" + Environment.NewLine +
- " )" + Environment.NewLine +
- Highlight ("public static ", colorStyle.KeywordModifiers) + Highlight ("implicit operator", colorStyle.KeywordOperatorDeclaration) + " conv-type-out ( conv-type-in operand )" + Environment.NewLine +
- Highlight ("public static ", colorStyle.KeywordModifiers) + Highlight ("explicit operator", colorStyle.KeywordOperatorDeclaration) + " conv-type-out ( conv-type-in operand )"
- );
- result.SummaryMarkup = "The " + Highlight ("operator", colorStyle.KeywordOperatorDeclaration) + " keyword is used to declare an operator in a class or struct declaration.";
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} result-type {1} unary-operator ( op-type operand )\n{0} result-type {1} binary-operator (\nop-type operand,\nop-type2 operand2\n )\n{0} {2} {1} conv-type-out ( conv-type-in operand )\n{0} {3} {1} conv-type-out ( conv-type-in operand )",
+ Highlight ("public static", colorStyle.KeywordModifiers), Highlight ("operator", colorStyle.KeywordOperatorDeclaration), Highlight ("implicit", colorStyle.KeywordOperatorDeclaration), Highlight ("explicit", colorStyle.KeywordOperatorDeclaration))
+ );
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to declare an operator in a class or struct declaration.", Highlight ("operator", colorStyle.KeywordOperatorDeclaration));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"),
+ GettextCatalog.GetString ("{0} order-key1 [ {1}|{2}, [order-key2, ...]", Highlight ("orderby", colorStyle.KeywordContext), Highlight ("ascending", colorStyle.KeywordContext), Highlight ("descending", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} clause specifies for the returned sequence to be sorted on a given element in either ascending or descending order.", Highlight ("orderby", colorStyle.KeywordContext));
break;
case SyntaxKind.OutKeyword:
result.SignatureMarkup = Highlight ("out", colorStyle.KeywordParameter) + keywordSign;
if (node.Parent != null) {
if (node.Parent is TypeParameterSyntax) {
- result.AddCategory ("Form",
- Highlight ("interface", colorStyle.KeywordDeclaration) + " IMyInterface&lt;" + Highlight ("out", colorStyle.KeywordParameter) + " T&gt; {}");
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} IMyInterface&lt;{1} T&gt; {}", Highlight ("interface", colorStyle.KeywordDeclaration), Highlight ("out", colorStyle.KeywordParameter)));
break;
}
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} parameter-name", Highlight ("out", colorStyle.KeywordParameter)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} method parameter keyword on a method parameter causes a method to refer to the same variable that was passed into the method.", Highlight ("out", colorStyle.KeywordParameter));
break;
}
}
- 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; {}"
- );
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} parameter-name\n\nor\n\n{1} IMyInterface&lt;{0} T&gt; {{}}",
+ Highlight ("out", colorStyle.KeywordParameter), Highlight ("interface", colorStyle.KeywordDeclaration)));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} modifier is used to override a method, a property, an indexer, or an event.", Highlight ("override", colorStyle.KeywordModifiers));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword lets you specify a method parameter that takes an argument where the number of arguments is variable.", Highlight ("params", colorStyle.KeywordParameter));
break;
case SyntaxKind.PartialKeyword:
result.SignatureMarkup = Highlight ("partial", colorStyle.KeywordContext) + keywordSign;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[modifiers] {0} type-declaration", Highlight ("partial", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword on a type declaration allows for the definition to be split into multiple files.", Highlight ("partial", colorStyle.KeywordContext));
break;
} 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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} method-declaration", Highlight ("partial", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword on a method declaration allows for the implementation of a method to be defined in another part of the partial class.", Highlight ("partial", colorStyle.KeywordContext));
}
} else
- 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");
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("[modifiers] {0} type-declaration\n\nor\n\n{0} method-declaration", Highlight ("partial", colorStyle.KeywordContext)));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("private", colorStyle.KeywordModifiers));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("protected", colorStyle.KeywordModifiers));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("public", colorStyle.KeywordModifiers));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is a modifier that you can use on fields. When a field declaration includes a {0} 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.", Highlight ("readonly", colorStyle.KeywordModifiers));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} method parameter keyword on a method parameter causes a method to refer to the same variable that was passed into the method.", Highlight ("ref ", colorStyle.KeywordParameter));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[modifiers] {0} {{ accessor-body }}", Highlight ("remove", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to define a custom accessor for when an event is unsubscribed from. If supplied, an add accessor must also be supplied.", Highlight ("remove", colorStyle.KeywordContext));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} [expression];", Highlight ("return", colorStyle.KeywordJump)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement terminates execution of the method in which it appears and returns control to the calling method.", Highlight ("return ", colorStyle.KeywordJump));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"), GettextCatalog.GetString ("{0} return-type", Highlight ("select", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} clause specifies the type of value to return from the query.", Highlight ("select", colorStyle.KeywordContext));
break;
case SyntaxKind.SealedKeyword:
result.SignatureMarkup = Highlight ("sealed", colorStyle.KeywordModifiers) + keywordSign;
- result.SummaryMarkup = "A sealed class cannot be inherited.";
+ result.SummaryMarkup = GettextCatalog.GetString ("A sealed class cannot be inherited.");
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[modifiers] {0} [ {{ accessor-body }} ]", Highlight ("set", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to define an accessor method to assign to the value of the property or indexer element.", Highlight ("set", colorStyle.KeywordContext));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} (type)", Highlight ("sizeof", colorStyle.KeywordOperators)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} operator is used to obtain the size in bytes for a value type.", Highlight ("sizeof", colorStyle.KeywordOperators));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("type * ptr = {0} type [ expr ];", Highlight ("stackalloc", colorStyle.KeywordOperators)));
+ result.SummaryMarkup = GettextCatalog.GetString ("Allocates a block of memory on the stack.");
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("Use the {0} modifier to declare a static member, which belongs to the type itself rather than to a specific object.", Highlight ("static", colorStyle.KeywordModifiers));
break;
case SyntaxKind.StructKeyword:
result.SignatureMarkup = Highlight ("struct", colorStyle.KeywordDeclaration) + keywordSign;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} constraint specifies that the type argument must be a value type. Any value type except Nullable can be specified.", Highlight ("struct", colorStyle.KeywordDeclaration));
} 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. ";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("[attributes] [modifiers] {0} identifier [:interfaces] body [;]", Highlight ("struct", colorStyle.KeywordDeclaration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("A {0} type is a value type that can contain constructors, constants, fields, methods, properties, indexers, operators, events, and nested types.", Highlight ("struct", colorStyle.KeywordDeclaration));
}
break;
case SyntaxKind.SwitchKeyword:
result.SignatureMarkup = Highlight ("switch", colorStyle.KeywordSelection) + keywordSign;
- result.AddCategory ("Form", Highlight ("switch", colorStyle.KeywordSelection) + " (expression)" + Environment.NewLine +
- " {" + 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 +
- " }");
- 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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} (expression)\n {{\n {1} constant-expression:\n statement\n jump-statement\n [{2}:\n statement\n jump-statement]\n }}", Highlight ("switch", colorStyle.KeywordSelection), Highlight ("case ", colorStyle.KeywordSelection), Highlight ("default", colorStyle.KeywordSelection)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement is a control statement that handles multiple selections by passing control to one of the {1} statements within its body.", Highlight ("switch", colorStyle.KeywordSelection), Highlight ("case", colorStyle.KeywordSelection));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword refers to the current instance of the class.", Highlight ("this", colorStyle.KeywordAccessors));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} [expression];", Highlight ("throw", colorStyle.KeywordException)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement is used to signal the occurrence of an anomalous situation (exception) during the program execution.", Highlight ("throw ", colorStyle.KeywordException));
break;
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 +
- " " + Highlight ("catch", colorStyle.KeywordException) + " (exception-declaration-2) catch-block-2 " + Environment.NewLine +
- "..." + Environment.NewLine +
- 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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"),
+ GettextCatalog.GetString ("{0} try-block\n {1} (exception-declaration-1) catch-block-1 \n {1} (exception-declaration-2) catch-block-2 \n...\n{0} try-block {1} catch-block",
+ Highlight ("try", colorStyle.KeywordException), Highlight ("catch", colorStyle.KeywordException)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The try-catch statement consists of a {0} block followed by one or more {1} clauses, which specify handlers for different exceptions.", Highlight ("try", colorStyle.KeywordException), Highlight ("catch", colorStyle.KeywordException));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} (type)", Highlight ("typeof", colorStyle.KeywordOperators)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} operator is used to obtain the System.Type object for a type.", Highlight ("typeof", colorStyle.KeywordOperators));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} block\n{0} (expression)", Highlight ("unchecked", colorStyle.KeywordOther)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to control the overflow-checking context for integral-type arithmetic operations and conversions.", Highlight ("unchecked", colorStyle.KeywordOther));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword denotes an unsafe context, which is required for any operation involving pointers.", Highlight ("unsafe", colorStyle.KeywordOther));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} (expression | type identifier = initializer) statement\n{0} [alias = ]class_or_namespace;", Highlight ("using", colorStyle.KeywordNamespace)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} directive creates an alias for a namespace or imports types defined in other namespaces. The {0} statement defines a scope at the end of which an object will be disposed.", Highlight ("using", colorStyle.KeywordNamespace));
break;
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.";
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a derived class.", Highlight ("virtual", colorStyle.KeywordModifiers));
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} declaration", Highlight ("volatile", colorStyle.KeywordModifiers)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} 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.", Highlight ("volatile", colorStyle.KeywordModifiers));
break;
case SyntaxKind.VoidKeyword:
result.SignatureMarkup = Highlight ("void", colorStyle.KeywordTypes) + keywordSign;
@@ -1475,37 +1425,33 @@ namespace MonoDevelop.CSharp
result.SignatureMarkup = Highlight ("where", colorStyle.KeywordContext) + keywordSign;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Query Form"), GettextCatalog.GetString ("{0} condition", Highlight ("where", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} clause specifies which elements from the data source to be returned according to a given condition.", Highlight ("where", colorStyle.KeywordContext));
break;
}
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("generic-class-declaration {0} type-parameter : type-constraint", Highlight ("where", colorStyle.KeywordContext)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} clause constrains which types can be used as the type parameter in a generic declaration.", Highlight ("where", colorStyle.KeywordContext));
break;
}
} else {
- result.AddCategory ("Form", "generic-class-declaration " + Highlight ("where", colorStyle.KeywordContext) + " type-parameter : type-constraint"
- + Environment.NewLine + Environment.NewLine + "or" + Environment.NewLine + Environment.NewLine + "query-clauses " + Highlight ("where", colorStyle.KeywordContext) +
- " condition" + " [query-clauses]");
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("generic-class-declaration {0} type-parameter : type-constraint\n\nor\n\nquery-clauses {0} condition [query-clauses]", Highlight ("where", colorStyle.KeywordContext)));
}
break;
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} {1}\n\nor\n\n{0} {2} expression", Highlight ("yield", colorStyle.KeywordContext), Highlight ("break", colorStyle.KeywordJump), Highlight ("return", colorStyle.KeywordJump)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} keyword is used to indicate that a method, get accessor, or operator is an iterator.", Highlight ("yield", colorStyle.KeywordContext));
break;
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. ";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0} (expression) statement", Highlight ("while", colorStyle.KeywordIteration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("The {0} statement executes a statement or a block of statements until a specified expression evaluates to false.", Highlight ("while", colorStyle.KeywordIteration));
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.";
+ result.AddCategory (GettextCatalog.GetString ("Form"), GettextCatalog.GetString ("{0}(identifier)", Highlight ("nameof", colorStyle.KeywordDeclaration)));
+ result.SummaryMarkup = GettextCatalog.GetString ("Used to obtain the simple (unqualified) string name of a variable, type, or member.");
break;
default:
return null;
@@ -1520,19 +1466,19 @@ namespace MonoDevelop.CSharp
var color = AlphaBlend (colorStyle.PlainText.Foreground, colorStyle.PlainText.Background, optionalAlpha);
var colorString = MonoDevelop.Components.HelperMethods.GetColorString (color);
- var keywordSign = "<span foreground=\"" + colorString + "\">" + " (keyword)</span>";
+ var keywordSign = "<span foreground=\"" + colorString + "\"> " + GettextCatalog.GetString ("(keyword)") + "</span>";
result.SignatureMarkup = Highlight (keyword.ToFullString (), colorStyle.KeywordTypes) + keywordSign;
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.");
+ result.AddCategory (GettextCatalog.GetString ("Constraint"), GettextCatalog.GetString ("The type argument must be a reference type; this applies also to any class, interface, delegate, or array type."));
break;
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.");
+ result.AddCategory (GettextCatalog.GetString ("Constraint"), GettextCatalog.GetString ("The type argument must have a public parameterless constructor. When used together with other constraints, the new() constraint must be specified last."));
break;
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.");
+ result.AddCategory (GettextCatalog.GetString ("Constraint"), GettextCatalog.GetString ("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;
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs
index baedfa03c4..33564448cb 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs
@@ -166,13 +166,20 @@ namespace MonoDevelop.JSon
#endregion
#region IDocumentIndentEngine implementation
-
+ Indent savedStringIndent;
public void Push (char ch)
{
var isNewLine = NewLine.IsNewLine (ch);
if (!isNewLine) {
- if (ch == '"')
+ if (ch == '"') {
isInString = !IsInsideString;
+ if (isInString) {
+ savedStringIndent = nextLineIndent;
+ nextLineIndent = new Indent (ctx.GetOptionSet ());
+ } else {
+ nextLineIndent = savedStringIndent;
+ }
+ }
if (ch == '{' || ch == '[') {
nextLineIndent.Push (IndentType.Block);
} else if (ch == '}' || ch == ']') {
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs
index 9e81108f34..1121e293ad 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs
@@ -30,8 +30,7 @@ using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Editor.Extension;
using ICSharpCode.NRefactory6.CSharp;
using MonoDevelop.Ide.Editor;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.JSon
{
class JSonTextEditorExtension : TextEditorExtension
@@ -47,9 +46,9 @@ namespace MonoDevelop.JSon
stateTracker = new CacheIndentEngine (indentEngine);
Editor.SetIndentationTracker (new JSonIndentationTracker (Editor, stateTracker));
}
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
- var result = await base.KeyPress (descriptor);
+ var result = base.KeyPress (descriptor);
if (descriptor.SpecialKey == SpecialKey.Return) {
if (Editor.Options.IndentStyle == MonoDevelop.Ide.Editor.IndentStyle.Virtual) {
diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
index 4b6aefb313..951ce5cc55 100644
--- a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
+++ b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
@@ -161,7 +161,7 @@ namespace MonoDevelop.ChangeLogAddIn
return null;
if (File.Exists (clog))
- return await IdeApp.Workbench.OpenDocument (clog, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ return await IdeApp.Workbench.OpenDocument (clog, (Project) null, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
Document document = IdeApp.Workbench.NewDocument (clog, "text/plain", "");
document.Save();
diff --git a/main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs b/main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs
index c2831dfbfe..db187df352 100644
--- a/main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs
+++ b/main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs
@@ -99,7 +99,7 @@ namespace MonoDevelop.ChangeLogAddIn
AllowCommit = !requireComment;
if (!AuthorInformation.Default.IsValid) {
- msgLabel.Markup = "<b><span foreground='red'>" + GettextCatalog.GetString ("ChangeLog entries can't be generated.") + "</span></b>";
+ msgLabel.Markup = "<b><span foreground='" + Ide.Gui.Styles.ErrorForegroundColor.ToHexString (false) + "'>" + GettextCatalog.GetString ("ChangeLog entries can't be generated.") + "</span></b>";
pathLabel.Text = GettextCatalog.GetString ("The name or e-mail of the user has not been configured.");
logButton.Label = GettextCatalog.GetString ("Configure user data");
optionsButton.Visible = false;
@@ -114,11 +114,11 @@ namespace MonoDevelop.ChangeLogAddIn
string fc = GettextCatalog.GetString ("There are {0} files without a comment.\nThe ChangeLog entry for those files will not be generated.", uncommentedCount);
if (requireComment)
fc += "\n" + GettextCatalog.GetString ("Some of the projects require that files have comments when they are committed.");
- warning = "<b><span foreground='red'>" + fc + "</span></b>\n";
+ warning = "<b><span foreground='" + Ide.Gui.Styles.ErrorForegroundColor.ToHexString (false) + "'>" + fc + "</span></b>\n";
}
if (unknownFileCount > 0) {
string fc = GettextCatalog.GetPluralString ("{0} ChangeLog file not found. Some changes will not be logged.","{0} ChangeLog files not found. Some changes will not be logged.", unknownFileCount, unknownFileCount);
- msgLabel.Markup = warning + "<b><span foreground='red'>" + fc + "</span></b>";
+ msgLabel.Markup = warning + "<b><span foreground='" + Ide.Gui.Styles.ErrorForegroundColor.ToHexString (false) + "'>" + fc + "</span></b>";
pathLabel.Text = GettextCatalog.GetString ("Click on the 'Details' button for more info.");
} else if (entries.Count == 1) {
msgLabel.Markup = warning + "<b>" + GettextCatalog.GetString ("The following ChangeLog file will be updated:") + "</b>";
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 5cf009cc19..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
@@ -69,7 +69,7 @@ namespace MonoDevelop.Deployment.Targets
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 ();
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 29ec2ffc16..7fcdefd213 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.addin.xml
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.addin.xml
@@ -117,7 +117,7 @@
</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/ILAsmBinding/ILAsmBinding.addin.xml b/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml
index 50a119a9cb..f40c5d46d7 100644
--- a/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml
+++ b/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml
@@ -1,7 +1,7 @@
<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"/>
diff --git a/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs
index 51cbec79bf..2c5466ce0a 100644
--- a/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs
+++ b/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs
@@ -65,7 +65,7 @@ namespace MonoDevelop.MacIntegration
// 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)
+ if (IdeTheme.UserInterfaceTheme == Theme.Dark)
alert.Icon = img.WithStyles ("-dark").ToBitmap (GtkWorkarounds.GetScaleFactor ()).ToNSImage ();
else
alert.Icon = img.ToNSImage ();
diff --git a/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs
deleted file mode 100644
index 11f655b918..0000000000
--- a/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs
+++ /dev/null
@@ -1,262 +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;
-using MonoDevelop.Components;
-
-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 }) {
- IdeTheme.ApplyTheme (alert.Window);
- 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 4f01020f21..3b94b87407 100644
--- a/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs
+++ b/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs
@@ -34,7 +34,6 @@ 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;
diff --git a/main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs b/main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs
index 5483cbbd78..c8787d809f 100644
--- a/main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs
+++ b/main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs
@@ -32,7 +32,6 @@ 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/MacPlatform.addin.xml b/main/src/addins/MacPlatform/MacPlatform.addin.xml
index b30596b41a..2d1fcbd506 100644
--- a/main/src/addins/MacPlatform/MacPlatform.addin.xml
+++ b/main/src/addins/MacPlatform/MacPlatform.addin.xml
@@ -70,7 +70,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 500fb59a5f..4906339251 100644
--- a/main/src/addins/MacPlatform/MacPlatform.cs
+++ b/main/src/addins/MacPlatform/MacPlatform.cs
@@ -50,6 +50,8 @@ using MonoDevelop.Components;
using MonoDevelop.Components.MainToolbar;
using MonoDevelop.MacIntegration.MacMenu;
using MonoDevelop.Components.Extensions;
+using System.Runtime.InteropServices;
+using ObjCRuntime;
namespace MonoDevelop.MacIntegration
{
@@ -72,7 +74,10 @@ namespace MonoDevelop.MacIntegration
return applicationMenuName ?? BrandingService.ApplicationName;
}
set {
- applicationMenuName = value;
+ if (applicationMenuName != value) {
+ applicationMenuName = value;
+ OnApplicationMenuNameChanged ();
+ }
}
}
@@ -271,7 +276,6 @@ namespace MonoDevelop.MacIntegration
initedApp = true;
IdeApp.Workbench.RootWindow.DeleteEvent += HandleDeleteEvent;
- BrandingService.ApplicationNameChanged += ApplicationNameChanged;
if (MacSystemInformation.OsVersion >= MacSystemInformation.Lion) {
IdeApp.Workbench.RootWindow.Realized += (sender, args) => {
@@ -281,7 +285,7 @@ namespace MonoDevelop.MacIntegration
}
PatchGtkTheme ();
- NSNotificationCenter.DefaultCenter.AddObserver (NSCell.ControlTintChangedNotification, notif => Runtime.RunInMainThread (
+ NSNotificationCenter.DefaultCenter.AddObserver (NSCell.ControlTintChangedNotification, notif => Core.Runtime.RunInMainThread (
delegate {
Styles.LoadStyle();
PatchGtkTheme();
@@ -301,7 +305,7 @@ namespace MonoDevelop.MacIntegration
return GettextCatalog.GetString ("Hide {0}", ApplicationMenuName);
}
- static void ApplicationNameChanged (object sender, EventArgs e)
+ static void OnApplicationMenuNameChanged ()
{
Command aboutCommand = IdeApp.CommandService.GetCommand (HelpCommands.About);
if (aboutCommand != null)
@@ -396,7 +400,7 @@ namespace MonoDevelop.MacIntegration
//OpenFiles may pump the mainloop, but can't do that from an AppleEvent, so use a brief timeout
GLib.Timeout.Add (10, delegate {
IdeApp.OpenFiles (e.Documents.Select (
- doc => new FileOpenInformation (doc.Key, doc.Value, 1, OpenDocumentOptions.DefaultInternal))
+ doc => new FileOpenInformation (doc.Key, null, doc.Value, 1, OpenDocumentOptions.DefaultInternal))
);
return false;
});
@@ -422,7 +426,7 @@ namespace MonoDevelop.MacIntegration
if (!Int32.TryParse (qs ["column"], out column))
column = 1;
- return new FileOpenInformation (Uri.UnescapeDataString(fileUri.AbsolutePath),
+ return new FileOpenInformation (Uri.UnescapeDataString(fileUri.AbsolutePath), null,
line, column, OpenDocumentOptions.DefaultInternal);
} catch (Exception ex) {
LoggingService.LogError ("Invalid TextMate URI: " + url, ex);
@@ -445,48 +449,37 @@ namespace MonoDevelop.MacIntegration
}
}
+ [DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
+ public extern static IntPtr IntPtr_objc_msgSend_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
+
static void SetupDockIcon ()
{
- FilePath exePath = System.Reflection.Assembly.GetExecutingAssembly ().Location;
NSObject initialBundleIconFileValue;
- string iconFile = null;
-
- string appleTheme = NSUserDefaults.StandardUserDefaults.StringForKey ("AppleInterfaceStyle");
- // Try setting a dark variant of the application dock icon if one exists in the app bundle.
+ // Don't do anything if we're inside an app bundle.
if (NSBundle.MainBundle.InfoDictionary.TryGetValue (new NSString ("CFBundleIconFile"), out initialBundleIconFileValue)) {
- FilePath bundleIconRoot = GetAppBundleRoot (exePath).Combine ("Contents", "Resources");
- NSString initialBundleIconFile = (NSString)initialBundleIconFileValue;
+ return;
+ }
- if (appleTheme == "Dark") {
- iconFile = bundleIconRoot.Combine (Path.GetFileNameWithoutExtension (initialBundleIconFile) + "~dark" + Path.GetExtension (initialBundleIconFile));
- }
+ // Setup without bundle.
+ FilePath exePath = System.Reflection.Assembly.GetExecutingAssembly ().Location;
+ string iconName = BrandingService.GetString ("ApplicationIcon");
+ string iconFile = null;
- // There is no monodevelop~dark.icns, fallback to monodevelop.icns
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light || iconFile == null || !File.Exists (iconFile)) {
- iconFile = bundleIconRoot.Combine (initialBundleIconFile);
- }
+ if (iconName != null) {
+ iconFile = BrandingService.GetFile (iconName);
} else {
- // Setup without bundle.
- string iconName = BrandingService.GetString ("ApplicationIcon");
- if (iconName != null) {
- if (appleTheme == "Dark") {
- string darkIconName = Path.GetFileNameWithoutExtension (iconName) + "~dark" + Path.GetExtension (iconName);
- iconFile = BrandingService.GetFile (darkIconName);
- }
-
- if (appleTheme == "Light" || iconFile == null) {
- iconFile = BrandingService.GetFile (iconName);
- }
- } 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)) {
- NSApplication.SharedApplication.ApplicationIconImage = new NSImage (iconFile);
+ var image = new NSImage ();
+ var imageFile = new NSString (iconFile);
+
+ IntPtr p = IntPtr_objc_msgSend_IntPtr (image.Handle, Selector.GetHandle ("initByReferencingFile:"), imageFile.Handle);
+ NSApplication.SharedApplication.ApplicationIconImage = ObjCRuntime.Runtime.GetNSObject<NSImage> (p);
}
}
diff --git a/main/src/addins/MacPlatform/MacPlatform.csproj b/main/src/addins/MacPlatform/MacPlatform.csproj
index d8eb27bc3b..cdee35e0c6 100644
--- a/main/src/addins/MacPlatform/MacPlatform.csproj
+++ b/main/src/addins/MacPlatform/MacPlatform.csproj
@@ -19,6 +19,7 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ConsolePause>False</ConsolePause>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<NoWarn>1591;1573</NoWarn>
@@ -119,7 +120,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\MDMenuHeaderItem.cs" />
diff --git a/main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs b/main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs
index ec335ae567..bcea700164 100644
--- a/main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs
@@ -30,7 +30,7 @@ using CoreGraphics;
using Foundation;
using MonoDevelop.Core;
-using MonoDevelop.Core;
+using Xwt.Mac;
using MonoDevelop.Ide;
namespace MonoDevelop.MacIntegration.MainToolbar
@@ -77,6 +77,83 @@ namespace MonoDevelop.MacIntegration.MainToolbar
}
}
+ public override void ViewDidMoveToWindow ()
+ {
+ base.ViewDidMoveToWindow ();
+
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light) {
+ return;
+ }
+
+ // I'm sorry. I'm so so sorry.
+ // When the user has Graphite appearance set in System Preferences on El Capitan
+ // and they enter fullscreen mode, Cocoa doesn't respect the VibrantDark appearance
+ // making the toolbar background white instead of black, however the toolbar items do still respect
+ // the dark appearance, making them white on white.
+ //
+ // So, an absolute hack is to go through the toolbar hierarchy and make all the views background colours
+ // be the dark grey we wanted them to be in the first place.
+ //
+ // https://bugzilla.xamarin.com/show_bug.cgi?id=40160
+ //
+ if (Window == null || Window == MacInterop.GtkQuartz.GetWindow (IdeApp.Workbench.RootWindow)) {
+ if (Superview != null) {
+ Superview.WantsLayer = false;
+
+ if (Superview.Superview != null) {
+ Superview.Superview.WantsLayer = false;
+ }
+ }
+ return;
+ }
+
+ var bgColor = Styles.DarkToolbarBackgroundColor.ToNSColor ().CGColor;
+
+ // NSToolbarItemViewer
+ if (Superview != null) {
+ Superview.WantsLayer = true;
+ Superview.Layer.BackgroundColor = bgColor;
+
+ if (Superview.Superview != null) {
+ // _NSToolbarViewClipView
+ Superview.Superview.WantsLayer = true;
+ Superview.Superview.Layer.BackgroundColor = bgColor;
+
+ if (Superview.Superview.Superview != null && Superview.Superview.Superview.Superview != null) {
+ // NSTitlebarView
+ Superview.Superview.Superview.Superview.WantsLayer = true;
+ Superview.Superview.Superview.Superview.Layer.BackgroundColor = bgColor;
+ }
+ }
+ }
+ }
+
+ 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);
@@ -92,8 +169,8 @@ namespace MonoDevelop.MacIntegration.MainToolbar
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 - 10, 0, searchbarWidth, ToolbarWidgetHeight);
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark) {
+ SearchBar.Frame = new CGRect (Frame.Width - searchbarWidth, 0, searchbarWidth, ToolbarWidgetHeight);
} else {
nfloat elcapYOffset = 0;
nfloat elcapHOffset = 0;
@@ -107,7 +184,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
elcapYOffset = scaleFactor == 2 ? -0.5f : -1;
elcapHOffset = 1.0f;
}
- SearchBar.Frame = new CGRect (Frame.Width - searchbarWidth - 10, 0 + elcapYOffset, searchbarWidth, ToolbarWidgetHeight + elcapHOffset);
+ SearchBar.Frame = new CGRect (Frame.Width - searchbarWidth, 0 + elcapYOffset, searchbarWidth, ToolbarWidgetHeight + elcapHOffset);
}
var selectorSize = SelectorView.SizeThatFits (new CGSize (spaceLeft, ToolbarWidgetHeight));
diff --git a/main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs b/main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs
index 5c9766f166..badd37cc53 100644
--- a/main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs
@@ -41,11 +41,11 @@ namespace MonoDevelop.MacIntegration.MainToolbar
[Register]
class ButtonBar : NSSegmentedControl
{
- class DarkSkinSegmentedCell : NSSegmentedCell
+ class DarkThemeSegmentedCell : NSSegmentedCell
{
public override void DrawWithFrame (CGRect cellFrame, NSView inView)
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark) {
var inset = cellFrame.Inset (0.25f, 0.25f);
inset = new CGRect (inset.X, inset.Y + 2, inset.Width, inset.Height - 2);
@@ -86,7 +86,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public ButtonBar (IEnumerable<IButtonBarButton> buttons)
{
- Cell = new DarkSkinSegmentedCell ();
+ Cell = new DarkThemeSegmentedCell ();
this.buttons = buttons.ToList ();
diff --git a/main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs b/main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs
index c26018205f..b46affe54d 100644
--- a/main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs
@@ -79,7 +79,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
nfloat y = 0;
nfloat height = AwesomeBar.ToolbarWidgetHeight;
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark) {
y = 2;
height += 2;
} else {
diff --git a/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs b/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
index 134c778477..c3a14432be 100644
--- a/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
@@ -46,6 +46,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
internal NSToolbar widget;
internal Gtk.Window gtkWindow;
+ public static bool IsFullscreen { get; private set; }
AwesomeBar awesomeBar;
RunButton runButton {
@@ -140,15 +141,21 @@ namespace MonoDevelop.MacIntegration.MainToolbar
var item = widget.Items[0];
var abFrameInWindow = awesomeBar.ConvertRectToView (awesomeBar.Frame, null);
- var awesomebarHeight = AwesomeBar.ToolbarWidgetHeight;//MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 24 : 22;
+ var awesomebarHeight = AwesomeBar.ToolbarWidgetHeight;
var size = new CGSize (win.Frame.Width - abFrameInWindow.X - 4, awesomebarHeight);
+
item.MinSize = size;
item.MaxSize = size;
});
+ // We can't use the events that Xamarin.Mac adds for delegate methods as they will overwrite
+ // the delegate that Gtk has added
NSWindow nswin = GtkMacInterop.GetNSWindow (window);
NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, resizeAction, nswin);
NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidEndLiveResizeNotification, resizeAction, nswin);
+
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.WillEnterFullScreenNotification, (note) => IsFullscreen = true, nswin);
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.WillExitFullScreenNotification, (note) => IsFullscreen = false, nswin);
}
internal void Initialize ()
diff --git a/main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs b/main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs
index d4221451f7..0e0e2f5656 100644
--- a/main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs
@@ -56,7 +56,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
static string MakeResName (string filename, string style, bool retina = false)
{
- bool dark = IdeApp.Preferences.UserInterfaceSkin == Skin.Dark;
+ bool dark = IdeApp.Preferences.UserInterfaceTheme == Theme.Dark;
if (!string.IsNullOrEmpty (style)) {
style = "~" + style;
diff --git a/main/src/addins/MacPlatform/MainToolbar/RunButton.cs b/main/src/addins/MacPlatform/MainToolbar/RunButton.cs
index cc49a859e2..fc8cf20267 100644
--- a/main/src/addins/MacPlatform/MainToolbar/RunButton.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/RunButton.cs
@@ -63,13 +63,13 @@ namespace MonoDevelop.MacIntegration.MainToolbar
buildIcon = MultiResImage.CreateMultiResImage ("build", "");
// We can use Template images supported by NSButton, thus no reloading
- // on theme/skin change is required.
+ // on theme change is required.
stopIcon.Template = continueIcon.Template = buildIcon.Template = true;
}
void UpdateCell ()
{
- Appearance = NSAppearance.GetAppearance (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark ? NSAppearance.NameVibrantDark : NSAppearance.NameAqua);
+ Appearance = NSAppearance.GetAppearance (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark ? NSAppearance.NameVibrantDark : NSAppearance.NameAqua);
NeedsDisplay = true;
}
@@ -118,7 +118,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
{
public override void DrawBezelWithFrame (CGRect frame, NSView controlView)
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark) {
var inset = frame.Inset (0.25f, 0.25f);
var path = NSBezierPath.FromRoundedRect (inset, 3, 3);
@@ -131,10 +131,17 @@ namespace MonoDevelop.MacIntegration.MainToolbar
//
// However after switching theme this filter is removed and the colour set here is the actual colour
// displayed onscreen.
- Styles.DarkBorderBrokenColor.ToNSColor ().SetStroke ();
+
+ // This also seems to happen in fullscreen mode
+ if (MainToolbar.IsFullscreen) {
+ Styles.DarkBorderColor.ToNSColor ().SetStroke ();
+ } else {
+ Styles.DarkBorderBrokenColor.ToNSColor ().SetStroke ();
+ }
+
path.Stroke ();
} else {
- if (controlView.Window.Screen.BackingScaleFactor == 2) {
+ if (controlView.Window?.Screen?.BackingScaleFactor == 2) {
frame = new CGRect (frame.X, frame.Y + 0.5f, frame.Width, frame.Height);
}
base.DrawBezelWithFrame (frame, controlView);
@@ -144,7 +151,17 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public override void DrawInteriorWithFrame (CGRect cellFrame, NSView inView)
{
cellFrame = new CGRect (cellFrame.X, cellFrame.Y + 0.5f, cellFrame.Width, cellFrame.Height);
+
+ var old = Enabled;
+
+ // In fullscreen mode with dark theme on El Capitan, the disabled icon picked is for the
+ // normal appearance so it is too dark. Hack this so it comes up lighter.
+ // For further information see the comment in AwesomeBar.cs
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark && MainToolbar.IsFullscreen) {
+ Enabled = true;
+ }
base.DrawInteriorWithFrame (cellFrame, inView);
+ Enabled = old;
}
}
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs b/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs
index 11b73a8bd5..d820039ed9 100644
--- a/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs
@@ -38,7 +38,6 @@ namespace MonoDevelop.MacIntegration.MainToolbar
[Register]
class SearchBar : NSSearchField
{
- bool debugSearchbar;
internal Widget gtkWidget;
internal event EventHandler<Xwt.KeyEventArgs> KeyPressed;
internal event EventHandler LostFocus;
@@ -48,17 +47,23 @@ namespace MonoDevelop.MacIntegration.MainToolbar
// 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
+ class DarkThemeSearchFieldCell : NSSearchFieldCell
{
public override void DrawWithFrame (CGRect cellFrame, NSView inView)
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.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 ();
+ // Hack to make the border be the correct colour in fullscreen mode
+ // See comment in AwesomeBar.cs for more details
+ if (MainToolbar.IsFullscreen) {
+ Styles.DarkBorderBrokenColor.ToNSColor ().SetStroke ();
+ } else {
+ Styles.DarkBorderColor.ToNSColor ().SetStroke ();
+ }
path.Stroke ();
}
@@ -79,7 +84,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
CancelButtonCell.DrawWithFrame (CancelButtonRectForBounds (inset), inView);
}
} else {
- if (inView.Window.Screen.BackingScaleFactor == 2) {
+ if (inView.Window?.Screen?.BackingScaleFactor == 2) {
nfloat yOffset = 0f;
nfloat hOffset = 0f;
@@ -145,7 +150,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
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) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark) {
xOffset = -1.5f;
}
// y does not appear to affect anything. Whatever value is set here for y will always be 1px below the
@@ -174,11 +179,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public SearchBar ()
{
- Cell = new DarkSkinSearchFieldCell ();
+ Cell = new DarkThemeSearchFieldCell ();
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 ();
diff --git a/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs b/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
index 85db735e52..009f6b3ac0 100644
--- a/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
@@ -307,6 +307,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public override void MouseDown (NSEvent theEvent)
{
+ if (!Enabled)
+ return;
+
var locationInView = ConvertPointFromView (theEvent.LocationInWindow, null);
var cellIdx = IndexOfCellAtX (locationInView.X);
@@ -315,11 +318,10 @@ namespace MonoDevelop.MacIntegration.MainToolbar
}
var item = PathComponentCells [cellIdx];
- if (item == null)
+ if (item == null || !item.Enabled)
return;
var componentRect = ((NSPathCell)Cell).GetRect (item, Frame, this);
- int idx = -1;
int i = 0;
NSMenuItem selectedItem = null;
@@ -376,7 +378,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
if (menu.Count > 1) {
var offs = new CGPoint (componentRect.Left + 3, componentRect.Top + 3);
- if (Window.Screen.BackingScaleFactor == 2)
+ if (Window?.Screen?.BackingScaleFactor == 2)
offs.Y += 0.5f; // fine tune menu position on retinas
menu.PopUpMenu (selectedItem, offs, this);
@@ -449,7 +451,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
// 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 [ConfigurationIdx].Image = MultiResImage.CreateMultiResImage ("project", projectStyle);
PathComponentCells [RuntimeIdx].Image = MultiResImage.CreateMultiResImage ("device", deviceStyle);
RealignTexts ();
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
index 35c0fd229e..74a12e0393 100644
--- a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
@@ -219,6 +219,8 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public void BeginProgress ()
{
oldFraction = 0.0;
+ progressLayer.RemoveAllAnimations ();
+
progressLayer.Hidden = false;
progressLayer.Opacity = 1;
progressLayer.Frame = new CGRect (0, 0, 0, barHeight);
@@ -273,8 +275,13 @@ namespace MonoDevelop.MacIntegration.MainToolbar
void AttachFadeoutAnimation (CALayer progress, CAAnimation animation, Func<bool> fadeoutVerifier)
{
animation.AnimationStopped += (sender, e) => {
- if (!fadeoutVerifier ())
+ if (!fadeoutVerifier ()) {
return;
+ }
+
+ if (!e.Finished) {
+ return;
+ }
CABasicAnimation fadeout = CABasicAnimation.FromKeyPath ("opacity");
fadeout.From = NSNumber.FromDouble (1);
@@ -286,9 +293,17 @@ namespace MonoDevelop.MacIntegration.MainToolbar
if (!e2.Finished)
return;
+ // Reset all the properties.
inProgress = false;
- progress.Opacity = 0;
+
+ progress.Hidden = true;
+
+ progress.Opacity = 1;
+ progress.Frame = new CGRect (0, 0, 0, barHeight);
progress.RemoveAllAnimations ();
+ oldFraction = 0.0;
+
+ progress.Hidden = false;
};
progress.Name = ProgressLayerFadingId;
progress.AddAnimation (fadeout, "opacity");
@@ -337,8 +352,6 @@ namespace MonoDevelop.MacIntegration.MainToolbar
const string ProgressLayerFadingId = "ProgressLayerFading";
const string growthAnimationKey = "bounds";
StatusBarContextHandler ctxHandler;
- Stack<double> progressMarks = new Stack<double> ();
- bool currentTextIsMarkup;
string text;
MessageType messageType;
NSColor textColor;
@@ -449,7 +462,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
void UpdateApplicationNamePlaceholderText ()
{
- textField.Cell.PlaceholderAttributedString = GetStatusString (BrandingService.ApplicationName, ColorForType (MessageType.Ready));
+ textField.Cell.PlaceholderAttributedString = GetStatusString (BrandingService.ApplicationLongName, ColorForType (MessageType.Ready));
}
void ApplicationNameChanged (object sender, EventArgs e)
@@ -466,13 +479,13 @@ namespace MonoDevelop.MacIntegration.MainToolbar
void LoadStyles (object sender = null, EventArgs args = null)
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark) {
Appearance = NSAppearance.GetAppearance (NSAppearance.NameVibrantDark);
} else {
Appearance = NSAppearance.GetAppearance (NSAppearance.NameAqua);
}
- textField.Cell.PlaceholderAttributedString = GetStatusString (BrandingService.ApplicationName, ColorForType (MessageType.Ready));
+ UpdateApplicationNamePlaceholderText ();
textColor = ColorForType (messageType);
ReconstructString ();
}
@@ -515,7 +528,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
{
if (string.IsNullOrEmpty (text)) {
textField.AttributedStringValue = new NSAttributedString ("");
- textField.Cell.PlaceholderAttributedString = GetStatusString (BrandingService.ApplicationName, ColorForType (MessageType.Ready));
+ UpdateApplicationNamePlaceholderText ();
imageView.Image = ImageService.GetIcon (Stock.StatusSteady).ToNSImage ();
} else {
textField.AttributedStringValue = GetStatusString (text, textColor);
@@ -611,6 +624,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public void ShowReady ()
{
ShowMessage (null, "", false, MessageType.Ready);
+ SetMessageSourcePad (null);
}
static Pad sourcePad;
@@ -669,7 +683,6 @@ namespace MonoDevelop.MacIntegration.MainToolbar
return false;
text = message;
- currentTextIsMarkup = isMarkup;
messageType = statusType;
textColor = ColorForType (statusType);
diff --git a/main/src/addins/MacPlatform/MainToolbar/Styles.cs b/main/src/addins/MacPlatform/MainToolbar/Styles.cs
index 0c4878aac4..a877a4a361 100644
--- a/main/src/addins/MacPlatform/MainToolbar/Styles.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/Styles.cs
@@ -41,6 +41,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
// Dark workaround colors
public static Color DarkBorderColor { get; private set; }
public static Color DarkBorderBrokenColor { get; private set; }
+ public static Color DarkToolbarBackgroundColor { get; private set; }
static Styles ()
{
@@ -50,7 +51,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public static void LoadStyles ()
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light) {
BaseBackgroundColor = Ide.Gui.Styles.BaseBackgroundColor;
BaseForegroundColor = Ide.Gui.Styles.BaseForegroundColor;
DisabledForegroundColor = Xwt.Mac.Util.ToXwtColor (AppKit.NSColor.DisabledControlText); //Ide.Gui.Styles.DimTextColor;
@@ -72,6 +73,8 @@ namespace MonoDevelop.MacIntegration.MainToolbar
// To get the DarkBorderColor we need to use a workaround.
// See comment in ColoredButtonCell.DrawBezelWithFrame (RunButton.cs)
DarkBorderBrokenColor = Color.FromName ("#3e3e3e");
+
+ DarkToolbarBackgroundColor = Color.FromName ("#4e4e4e");
}
}
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
index 8c24cc2b07..2e83c8e4b1 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
@@ -165,10 +165,10 @@ namespace MonoDevelop.AssemblyBrowser
var netProject = project as DotNetProject;
if (netProject == null)
continue;
- foreach (string file in await netProject.GetReferencedAssemblies (ConfigurationSelector.Default, false)) {
- if (!System.IO.File.Exists (file))
+ foreach (var file in await netProject.GetReferencedAssemblies (ConfigurationSelector.Default, false)) {
+ if (!System.IO.File.Exists (file.FilePath))
continue;
- Widget.AddReferenceByFileName (file);
+ Widget.AddReferenceByFileName (file.FilePath);
}
}
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs
index ebbdb39a3a..b7d85a10a7 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs
@@ -156,37 +156,7 @@ namespace MonoDevelop.AssemblyBrowser
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 ()
{
@@ -257,9 +227,6 @@ namespace MonoDevelop.AssemblyBrowser
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 (),
new ProjectNodeBuilder (this),
@@ -498,9 +465,7 @@ namespace MonoDevelop.AssemblyBrowser
if (p == null)
continue;
AppendTypeReference (result, p.Type);
- if (p.IsOut)
- result.Append ("&");
- if (p.IsRef) {
+ if (p.IsRef || p.IsOut) {
result.Append ("@");
}
}
@@ -1387,7 +1352,7 @@ namespace MonoDevelop.AssemblyBrowser
void OpenFromAssembly (string url, AssemblyLoader currentAssembly, bool expandNode = true)
{
- var cecilObject = loader.GetCecilObject (currentAssembly.UnresolvedAssembly);
+ var cecilObject = currentAssembly.CecilLoader.GetCecilObject (currentAssembly.UnresolvedAssembly);
if (cecilObject == null)
return;
@@ -1426,7 +1391,7 @@ namespace MonoDevelop.AssemblyBrowser
{
var tasks = new List<Task> ();
foreach (var definition in definitions.ToArray ()) {
- var cecilObject = loader.GetCecilObject (definition.UnresolvedAssembly);
+ var cecilObject = definition.CecilLoader.GetCecilObject (definition.UnresolvedAssembly);
if (cecilObject == null) {
LoggingService.LogWarning ("Assembly browser: Can't find assembly: " + definition.UnresolvedAssembly.FullAssemblyName + ".");
continue;
@@ -1474,7 +1439,7 @@ namespace MonoDevelop.AssemblyBrowser
AssemblyDefinition cu = null;
foreach (var unit in definitions) {
if (unit.UnresolvedAssembly.AssemblyName == fileName)
- cu = loader.GetCecilObject (unit.UnresolvedAssembly);
+ cu = unit.CecilLoader.GetCecilObject (unit.UnresolvedAssembly);
}
if (cu == null)
return;
@@ -1558,7 +1523,6 @@ namespace MonoDevelop.AssemblyBrowser
this.UIManager = null;
}
- this.loader = null;
this.languageCombobox.Changed -= LanguageComboboxhandleChanged;
// this.searchInCombobox.Changed -= SearchInComboboxhandleChanged;
// this.searchEntry.Changed -= SearchEntryhandleChanged;
@@ -1576,13 +1540,7 @@ namespace MonoDevelop.AssemblyBrowser
}
}
- CecilLoader loader;
- internal CecilLoader CecilLoader {
- get {
- return loader;
- }
- }
-
+
List<AssemblyLoader> definitions = new List<AssemblyLoader> ();
List<Project> projects = new List<Project> ();
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs
index ff807c4658..645a99490b 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs
@@ -30,6 +30,7 @@ using System.Threading.Tasks;
using MonoDevelop.Core;
using System.IO;
using System.Threading;
+using System.Collections.Generic;
namespace MonoDevelop.AssemblyBrowser
{
@@ -65,7 +66,15 @@ namespace MonoDevelop.AssemblyBrowser
return assemblyLoaderTask.Result.Item2;
}
}
-
+
+ CecilLoader loader;
+ internal CecilLoader CecilLoader {
+ get {
+ return loader;
+ }
+ }
+
+
public AssemblyLoader (AssemblyBrowserWidget widget, string fileName)
{
if (widget == null)
@@ -76,19 +85,57 @@ namespace MonoDevelop.AssemblyBrowser
FileName = fileName;
if (!File.Exists (fileName))
throw new ArgumentException ("File doesn't exist.", nameof (fileName));
- assemblyLoaderTask = Task.Run (() => {
+
+ loader = new CecilLoader (true);
+ loader.InterningProvider = new FastNonInterningProvider ();
+ loader.IncludeInternalMembers = true;
+
+ assemblyLoaderTask = Task.Run ( () => {
try {
var asm = AssemblyDefinition.ReadAssembly (FileName, new ReaderParameters {
AssemblyResolver = this
});
- return Tuple.Create (asm, widget.CecilLoader.LoadAssembly (asm));
+ var loadedAssembley = loader.LoadAssembly (asm);
+ return Tuple.Create (asm, loadedAssembley);
} catch (Exception e) {
LoggingService.LogError ("Error while reading assembly " + FileName, e);
return null;
}
}, src.Token);
}
-
+
+ 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;
+ }
+ }
+
#region IAssemblyResolver implementation
AssemblyDefinition IAssemblyResolver.Resolve (AssemblyNameReference name)
{
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 683c8b04a1..c1c3f12c23 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyBrowserTypeNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyBrowserTypeNodeBuilder.cs
@@ -50,10 +50,9 @@ namespace MonoDevelop.AssemblyBrowser
}
}
- internal CecilLoader CecilLoader {
- get {
- return Widget.CecilLoader;
- }
+ internal CecilLoader GetCecilLoader (ITreeNavigator navigator)
+ {
+ return navigator.GetParentDataItem<AssemblyLoader> (false).CecilLoader;
}
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
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 ed73ec940b..b502934da5 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyNodeBuilder.cs
@@ -148,8 +148,9 @@ namespace MonoDevelop.AssemblyBrowser
public List<ReferenceSegment> Disassemble (TextEditor data, ITreeNavigator navigator)
{
- var assembly = ((AssemblyLoader)navigator.DataItem).UnresolvedAssembly;
- var compilationUnit = Widget.CecilLoader.GetCecilObject (assembly);
+ var assemblyLoader = (AssemblyLoader)navigator.DataItem;
+ var assembly = assemblyLoader.UnresolvedAssembly;
+ var compilationUnit = assemblyLoader.CecilLoader.GetCecilObject (assembly);
if (compilationUnit == null) {
LoggingService.LogError ("Can't get cecil object for assembly:" + assembly);
return new List<ReferenceSegment> ();
@@ -160,8 +161,9 @@ namespace MonoDevelop.AssemblyBrowser
public List<ReferenceSegment> Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
- var assembly = ((AssemblyLoader)navigator.DataItem).UnresolvedAssembly;
- var compilationUnit = Widget.CecilLoader.GetCecilObject (assembly);
+ var assemblyLoader = (AssemblyLoader)navigator.DataItem;
+ var assembly = assemblyLoader.UnresolvedAssembly;
+ var compilationUnit = assemblyLoader.CecilLoader.GetCecilObject (assembly);
if (compilationUnit == null) {
LoggingService.LogError ("Can't get cecil object for assembly:" + assembly);
return new List<ReferenceSegment> ();
@@ -174,8 +176,9 @@ namespace MonoDevelop.AssemblyBrowser
List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
- var assembly = ((AssemblyLoader)navigator.DataItem).UnresolvedAssembly;
- var compilationUnit = Widget.CecilLoader.GetCecilObject (assembly);
+ var assemblyLoader = (AssemblyLoader)navigator.DataItem;
+ var assembly = assemblyLoader.UnresolvedAssembly;
+ var compilationUnit = assemblyLoader.CecilLoader.GetCecilObject (assembly);
if (compilationUnit == null) {
LoggingService.LogError ("Can't get cecil object for assembly:" + assembly);
return new List<ReferenceSegment> ();
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 c03962bf13..bf485b6e7e 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomEventNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomEventNodeBuilder.cs
@@ -95,7 +95,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var evt = CecilLoader.GetCecilObject ((IUnresolvedEvent)navigator.DataItem);
+ var evt = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedEvent)navigator.DataItem);
return DomMethodNodeBuilder.Disassemble (data, rd => rd.DisassembleEvent (evt));
}
@@ -103,7 +103,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var evt = CecilLoader.GetCecilObject ((IUnresolvedEvent)navigator.DataItem);
+ var evt = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedEvent)navigator.DataItem);
if (evt == null)
return null;
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), evt.DeclaringType, b => b.AddEvent (evt));
@@ -113,7 +113,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var evt = CecilLoader.GetCecilObject ((IUnresolvedEvent)navigator.DataItem);
+ var evt = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedEvent)navigator.DataItem);
if (evt == null)
return null;
return DomMethodNodeBuilder.GetSummary (data, DomMethodNodeBuilder.GetModule (navigator), evt.DeclaringType, b => b.AddEvent (evt));
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 fcdd6b8672..6433e0cd8f 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomFieldNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomFieldNodeBuilder.cs
@@ -81,7 +81,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var field = CecilLoader.GetCecilObject ((IUnresolvedField)navigator.DataItem);
+ var field = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedField)navigator.DataItem);
if (field == null)
return null;
return DomMethodNodeBuilder.Disassemble (data, rd => rd.DisassembleField (field));
@@ -91,7 +91,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var field = CecilLoader.GetCecilObject ((IUnresolvedField)navigator.DataItem);
+ var field = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedField)navigator.DataItem);
if (field == null)
return null;
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), field.DeclaringType, b => b.AddField (field));
@@ -101,7 +101,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var field = CecilLoader.GetCecilObject ((IUnresolvedField)navigator.DataItem);
+ var field = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedField)navigator.DataItem);
if (field == null)
return null;
return DomMethodNodeBuilder.GetSummary (data, DomMethodNodeBuilder.GetModule (navigator), field.DeclaringType, b => b.AddField (field));
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 841aafac55..5ffc9e0953 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomMethodNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomMethodNodeBuilder.cs
@@ -216,7 +216,7 @@ namespace MonoDevelop.AssemblyBrowser
var method = (IUnresolvedMethod)navigator.DataItem;
if (HandleSourceCodeEntity (navigator, data))
return null;
- var cecilMethod = CecilLoader.GetCecilObject (method);
+ var cecilMethod = GetCecilLoader (navigator).GetCecilObject (method);
if (cecilMethod == null)
return null;
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), cecilMethod.DeclaringType, b => b.AddMethod (cecilMethod));
@@ -227,7 +227,7 @@ namespace MonoDevelop.AssemblyBrowser
var method = (IUnresolvedMethod)navigator.DataItem;
if (HandleSourceCodeEntity (navigator, data))
return null;
- var cecilMethod = CecilLoader.GetCecilObject (method);
+ var cecilMethod = GetCecilLoader (navigator).GetCecilObject (method);
if (cecilMethod == null)
return null;
return DomMethodNodeBuilder.GetSummary (data, DomMethodNodeBuilder.GetModule (navigator), cecilMethod.DeclaringType, b => b.AddMethod (cecilMethod));
@@ -269,7 +269,7 @@ namespace MonoDevelop.AssemblyBrowser
var method = (IUnresolvedMethod)navigator.DataItem;
if (HandleSourceCodeEntity (navigator, data))
return null;
- var cecilMethod = CecilLoader.GetCecilObject (method);
+ var cecilMethod = GetCecilLoader (navigator).GetCecilObject (method);
if (cecilMethod == null)
return null;
return Disassemble (data, rd => rd.DisassembleMethod (cecilMethod));
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 9c69994a8c..2d59f4894c 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomPropertyNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomPropertyNodeBuilder.cs
@@ -91,7 +91,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var property = CecilLoader.GetCecilObject ((IUnresolvedProperty)navigator.DataItem);
+ var property = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedProperty)navigator.DataItem);
return DomMethodNodeBuilder.Disassemble (data, rd => rd.DisassembleProperty (property));
}
@@ -111,7 +111,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var property = CecilLoader.GetCecilObject ((IUnresolvedProperty)navigator.DataItem);
+ var property = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedProperty)navigator.DataItem);
if (property == null)
return null;
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), property.DeclaringType, b => b.AddProperty (property));
@@ -121,7 +121,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var property = CecilLoader.GetCecilObject ((IUnresolvedProperty)navigator.DataItem);
+ var property = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedProperty)navigator.DataItem);
if (property == null)
return null;
return DomMethodNodeBuilder.GetSummary (data, DomMethodNodeBuilder.GetModule (navigator), property.DeclaringType, b => b.AddProperty (property));
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 4bfa9b4ecc..c5c427b7fb 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomTypeNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomTypeNodeBuilder.cs
@@ -132,7 +132,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var type = CecilLoader.GetCecilObject ((IUnresolvedTypeDefinition)navigator.DataItem);
+ var type = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedTypeDefinition)navigator.DataItem);
if (type == null)
return null;
@@ -160,7 +160,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var type = CecilLoader.GetCecilObject ((IUnresolvedTypeDefinition)navigator.DataItem);
+ var type = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedTypeDefinition)navigator.DataItem);
if (type == null)
return null;
var types = DesktopService.GetMimeTypeInheritanceChain (data.MimeType);
@@ -175,7 +175,7 @@ namespace MonoDevelop.AssemblyBrowser
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
- var type = CecilLoader.GetCecilObject ((IUnresolvedTypeDefinition)navigator.DataItem);
+ var type = GetCecilLoader (navigator).GetCecilObject ((IUnresolvedTypeDefinition)navigator.DataItem);
if (type == null)
return null;
var types = DesktopService.GetMimeTypeInheritanceChain (data.MimeType);
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 00fa8d0e8b..dfd2462ca5 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs
@@ -66,9 +66,9 @@ namespace MonoDevelop.Debugger.PreviewVisualizers
if (label.Layout.GetLine (1) != null) {
label.Justify = Gtk.Justification.Left;
- var line15 = label.Layout.GetLine (15);
- if (line15 != null) {
- label.Text = value.Substring (0, line15.StartIndex).TrimEnd ('\r', '\n') + "\n…";
+ var trimmedLine = label.Layout.GetLine (50);
+ if (trimmedLine != null) {
+ label.Text = value.Substring (0, trimmedLine.StartIndex).TrimEnd ('\r', '\n') + "\n…";
}
}
@@ -88,7 +88,7 @@ namespace MonoDevelop.Debugger.PreviewVisualizers
var rawString = val.GetRawValue (ops) as RawValueString;
var length = rawString.Length;
if (length > 0) {
- return rawString.Substring (0, Math.Min (length, 4096));
+ return Mono.Debugging.Evaluation.ExpressionEvaluator.EscapeString (rawString.Substring (0, Math.Min (length, 4096)));
} else {
return "";
}
@@ -96,7 +96,7 @@ namespace MonoDevelop.Debugger.PreviewVisualizers
var rawArray = val.GetRawValue (ops) as RawValueArray;
var length = rawArray.Length;
if (length > 0) {
- return new string (rawArray.GetValues (0, Math.Min (length, 4096)) as char[]);
+ return Mono.Debugging.Evaluation.ExpressionEvaluator.EscapeString (new string (rawArray.GetValues (0, Math.Min (length, 4096)) as char []));
} else {
return "";
}
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 5451a66b67..f3a3a4dc33 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
@@ -1148,6 +1148,53 @@ namespace MonoDevelop.Debugger.Tests
val = Eval ("a as C");
Assert.AreEqual ("null", val.Value);
Assert.AreEqual ("C", val.TypeName);
+
+ val = Eval ("a as string");
+ Assert.AreEqual ("null", val.Value);
+ Assert.AreEqual ("System.String", val.TypeName);
+
+
+ // Is operator
+
+ val = Eval ("c is A");
+ Assert.AreEqual ("true", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("c is B");
+ Assert.AreEqual ("true", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("c is C");
+ Assert.AreEqual ("true", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("b is A");
+ Assert.AreEqual ("true", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("b is B");
+ Assert.AreEqual ("true", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("b is C");
+ Assert.AreEqual ("false", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("a is A");
+ Assert.AreEqual ("true", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("a is B");
+ Assert.AreEqual ("false", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("a is C");
+ Assert.AreEqual ("false", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
+
+ val = Eval ("a is string");
+ Assert.AreEqual ("false", val.Value);
+ Assert.AreEqual ("bool", val.TypeName);
// Enum cast
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/AttachToProcessDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/AttachToProcessDialog.cs
index 946fdec8b8..f63d1ed9ca 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/AttachToProcessDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/AttachToProcessDialog.cs
@@ -50,7 +50,7 @@ namespace MonoDevelop.Debugger
store = new Gtk.ListStore (typeof(ProcessInfo), typeof(string), typeof(string));
tree.Model = store;
tree.AppendColumn ("PID", new Gtk.CellRendererText (), "text", 1);
- tree.AppendColumn ("Process Name", new Gtk.CellRendererText (), "text", 2);
+ tree.AppendColumn (GettextCatalog.GetString ("Process Name"), new Gtk.CellRendererText (), "text", 2);
tree.RowActivated += OnRowActivated;
state = new TreeViewState (tree, 1);
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
index 9c395b5889..a225e29d0e 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
@@ -37,6 +37,8 @@ using Mono.Debugging.Client;
using MonoDevelop.Components.Docking;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide;
+using MonoDevelop.Components.AutoTest;
+using System.ComponentModel;
namespace MonoDevelop.Debugger
{
@@ -101,6 +103,9 @@ namespace MonoDevelop.Debugger
// The breakpoint list
store = new TreeStore (typeof(string), typeof (bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));
+ SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Icon", "store__Selected","store_FileName",
+ "store_Breakpoint", "store_Condition", "store_TraceExp", "store_HitCount", "store_LastTrace");
+ TypeDescriptor.AddAttributes (store, modelAttr);
tree = new PadTreeView ();
tree.Model = store;
@@ -265,7 +270,7 @@ namespace MonoDevelop.Debugger
var bp = be as Breakpoint;
if (bp != null) {
if (!string.IsNullOrEmpty (bp.FileName))
- IdeApp.Workbench.OpenDocument (bp.FileName, bp.Line, 1);
+ IdeApp.Workbench.OpenDocument (bp.FileName, null, bp.Line, 1);
}
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs
index 225366c8c1..735629c75f 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs
@@ -61,12 +61,12 @@ namespace MonoDevelop.Debugger
bool editing;
// Groupings for sensitivity
- HBox hboxFunction = new HBox (){ MarginLeft = 18 };
+ HBox hboxFunction = new HBox () { MarginLeft = 18 };
HBox hboxLocation = new HBox ();
HBox hboxException = new HBox ();
HBox hboxCondition = new HBox ();
- VBox vboxException = new VBox (){ MarginLeft = 18 };
- VBox vboxLocation = new VBox (){ MarginLeft = 18 };
+ VBox vboxException = new VBox () { MarginLeft = 18 };
+ VBox vboxLocation = new VBox () { MarginLeft = 18 };
// Breakpoint Action radios.
readonly RadioButton breakpointActionPause = new RadioButton (GettextCatalog.GetString ("Pause the program"));
readonly RadioButton breakpointActionPrint = new RadioButton (GettextCatalog.GetString ("Print a message and continue"));
@@ -77,10 +77,10 @@ namespace MonoDevelop.Debugger
readonly RadioButton stopOnException = new RadioButton (GettextCatalog.GetString ("When an exception is thrown"));
// Text entries
- readonly TextEntry entryFunctionName = new TextEntry (){ PlaceholderText = GettextCatalog.GetString ("e.g. System.Object.ToString") };
- readonly TextEntry entryLocationFile = new TextEntry (){ PlaceholderText = GettextCatalog.GetString ("e.g. Program.cs:15:5") };
- readonly TextEntryWithCodeCompletion entryExceptionType = new TextEntryWithCodeCompletion (){ PlaceholderText = GettextCatalog.GetString ("e.g. System.InvalidOperationException") };
- readonly TextEntry entryConditionalExpression = new TextEntry (){ PlaceholderText = GettextCatalog.GetString ("e.g. colorName == \"Red\"") };
+ readonly TextEntry entryFunctionName = new TextEntry () { PlaceholderText = GettextCatalog.GetString ("e.g. System.Object.ToString") };
+ readonly TextEntry entryLocationFile = new TextEntry () { PlaceholderText = GettextCatalog.GetString ("e.g. Program.cs:15:5") };
+ readonly TextEntryWithCodeCompletion entryExceptionType = new TextEntryWithCodeCompletion () { PlaceholderText = GettextCatalog.GetString ("e.g. System.InvalidOperationException") };
+ readonly TextEntry entryConditionalExpression = new TextEntry () { PlaceholderText = GettextCatalog.GetString ("e.g. colorName == \"Red\"") };
readonly TextEntry entryPrintExpression = new TextEntry () { PlaceholderText = GettextCatalog.GetString ("e.g. Value of 'name' is {name}") };
// Warning icon
@@ -133,7 +133,7 @@ namespace MonoDevelop.Debugger
tooltipWindow.Text = tip;
var rect = this.ScreenBounds;
tooltipWindow.ShowPopup ((Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget (this),
- new Gdk.Rectangle ((int)(ParentWindow.X - rect.X), (int)(ParentWindow.Y - rect.Y), (int)rect.Width, (int)rect.Height),
+ new Gdk.Rectangle ((int)(ParentWindow.X - rect.X), (int)(ParentWindow.Y - rect.Y), (int)rect.Width, (int)rect.Height),
MonoDevelop.Components.PopupPosition.Bottom);
}
return false;
@@ -197,7 +197,7 @@ namespace MonoDevelop.Debugger
ParsedLocation breakpointLocation = new ParsedLocation ();
BreakEvent be;
- string[] parsedParamTypes;
+ string [] parsedParamTypes;
string parsedFunction;
readonly HashSet<string> classes = new HashSet<string> ();
@@ -228,9 +228,14 @@ namespace MonoDevelop.Debugger
void Initialize ()
{
- Title = GettextCatalog.GetString (be == null ? "Create a Breakpoint" : "Edit Breakpoint");
- var buttonLabel = GettextCatalog.GetString (be == null ? "Create" : "Apply");
-
+ string buttonLabel;
+ if (be == null) {
+ Title = GettextCatalog.GetString ("Create a Breakpoint");
+ buttonLabel = GettextCatalog.GetString ("Create");
+ } else {
+ Title = GettextCatalog.GetString ("Edit Breakpoint");
+ buttonLabel = GettextCatalog.GetString ("Apply");
+ }
var actionGroup = new RadioButtonGroup ();
breakpointActionPause.Group = actionGroup;
breakpointActionPrint.Group = actionGroup;
@@ -357,7 +362,7 @@ namespace MonoDevelop.Debugger
DebuggingService.IsFeatureSupported (startup, DebuggerFeatures.ConditionalBreakpoints);
bool canTrace = DebuggingService.IsFeatureSupported (project, DebuggerFeatures.Tracepoints) ||
- DebuggingService.IsFeatureSupported (startup, DebuggerFeatures.Tracepoints);
+ DebuggingService.IsFeatureSupported (startup, DebuggerFeatures.Tracepoints);
breakpointActionPause.Sensitive = canTrace;
entryPrintExpression.Sensitive = canTrace;
@@ -417,8 +422,8 @@ namespace MonoDevelop.Debugger
checkIncludeSubclass.Active = true;
if (IdeApp.Workbench.ActiveDocument != null &&
- IdeApp.Workbench.ActiveDocument.Editor != null &&
- IdeApp.Workbench.ActiveDocument.FileName != FilePath.Null) {
+ IdeApp.Workbench.ActiveDocument.Editor != null &&
+ IdeApp.Workbench.ActiveDocument.FileName != FilePath.Null) {
breakpointLocation.Update (IdeApp.Workbench.ActiveDocument.FileName,
IdeApp.Workbench.ActiveDocument.Editor.CaretLine,
IdeApp.Workbench.ActiveDocument.Editor.CaretColumn);
@@ -449,7 +454,7 @@ namespace MonoDevelop.Debugger
if (!File.Exists (splitted [0])) {
//Maybe it's C:\filepath.ext
if (splitted.Length > 1 && File.Exists (splitted [0] + ":" + splitted [1])) {
- var newSplitted = new string[splitted.Length - 1];
+ var newSplitted = new string [splitted.Length - 1];
newSplitted [0] = splitted [0] + ":" + splitted [1];
for (int i = 2; i < splitted.Length; i++) {
newSplitted [i - 1] = splitted [i];
@@ -661,7 +666,7 @@ namespace MonoDevelop.Debugger
return result;
}
- static bool TryParseFunction (string signature, out string function, out string[] paramTypes)
+ static bool TryParseFunction (string signature, out string function, out string [] paramTypes)
{
int paramListStart = signature.IndexOf ('(');
int paramListEnd = signature.IndexOf (')');
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs
index c9dac745cd..8c4e058e05 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs
@@ -31,8 +31,7 @@ using MonoDevelop.Ide;
using MonoDevelop.Components;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Editor.Extension;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.Debugger
{
public class DebuggerConsoleView : ConsoleView, ICompletionWidget
@@ -269,18 +268,18 @@ namespace MonoDevelop.Debugger
Buffer.MoveMark (tokenBeginMark, iter);
}
- async void OnEditKeyRelease (object sender, Gtk.KeyReleaseEventArgs args)
+ void OnEditKeyRelease (object sender, Gtk.KeyReleaseEventArgs args)
{
UpdateTokenBeginMarker ();
if (keyHandled)
return;
- await CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
+ CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
PopupCompletion ();
}
- protected override async Task<bool> ProcessKeyPressEvent (Gtk.KeyPressEventArgs args)
+ protected override bool ProcessKeyPressEvent (Gtk.KeyPressEventArgs args)
{
keyHandled = false;
@@ -294,11 +293,11 @@ namespace MonoDevelop.Debugger
}
if (currentCompletionData != null) {
- if ((keyHandled = await CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier))))
+ if ((keyHandled = CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier))))
return true;
}
- return await base.ProcessKeyPressEvent (args);
+ return base.ProcessKeyPressEvent (args);
}
protected override void UpdateInputLineBegin ()
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
index fbd0d511a3..80a03e8cf4 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
@@ -102,7 +102,7 @@ namespace MonoDevelop.Debugger
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)));
+ var label = new Label (GettextCatalog.GetString ("{0} not found. Find source file at alternative location.", Path.GetFileName (sf.SourceLocation.FileName)));
hbox.TooltipText = sf.SourceLocation.FileName;
var color = (HslColor)editor.Options.GetColorStyle ().NotificationText.Foreground;
@@ -138,13 +138,13 @@ namespace MonoDevelop.Debugger
this.WorkbenchWindow.CloseWindow (false);
}
} else {
- MessageService.ShowWarning ("File checksum doesn't match.");
+ MessageService.ShowWarning (GettextCatalog.GetString("File checksum doesn't match."));
}
} else {
- MessageService.ShowWarning ("File not found.");
+ MessageService.ShowWarning (GettextCatalog.GetString ("File not found."));
}
} catch (Exception) {
- MessageService.ShowWarning ("Error opening file");
+ MessageService.ShowWarning (GettextCatalog.GetString ("Error opening file."));
}
};
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
index cbde327003..4a66b256fe 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
@@ -40,8 +40,7 @@ using MonoDevelop.Ide.TextEditing;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Editor.Extension;
using MonoDevelop.Ide.Fonts;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.Debugger
{
class ExceptionCaughtDialog : Gtk.Dialog
@@ -330,7 +329,7 @@ namespace MonoDevelop.Debugger
if (OnlyShowMyCodeCheckbox.Active && !isUserCode) {
if (!external) {
- var str = GettextCatalog.GetString ("<b>[External Code]</b>");
+ var str = "<b>" + GettextCatalog.GetString ("[External Code]") + "</b>";
model.AppendValues (null, str, false);
external = true;
}
@@ -772,14 +771,14 @@ namespace MonoDevelop.Debugger
class ExceptionCaughtTextEditorExtension: TextEditorExtension
{
- public override Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
if (descriptor.SpecialKey == SpecialKey.Escape && DebuggingService.ExceptionCaughtMessage != null &&
!DebuggingService.ExceptionCaughtMessage.IsMinimized &&
DebuggingService.ExceptionCaughtMessage.File.CanonicalPath == new FilePath(DocumentContext.Name).CanonicalPath) {
DebuggingService.ExceptionCaughtMessage.ShowMiniButton ();
- return Task.FromResult (true);
+ return true;
}
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 29b1a69936..f35088bf82 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs
@@ -108,17 +108,17 @@ namespace MonoDevelop.Debugger
}
}
- async void OnEditKeyRelease (object sender, EventArgs e)
+ void OnEditKeyRelease (object sender, EventArgs e)
{
if (keyHandled)
return;
- await CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
+ CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
PopupCompletion ((Entry) sender);
}
[GLib.ConnectBeforeAttribute]
- async void OnEditKeyPress (object sender, KeyPressEventArgs args)
+ void OnEditKeyPress (object sender, KeyPressEventArgs args)
{
keyHandled = false;
@@ -132,7 +132,7 @@ namespace MonoDevelop.Debugger
}
if (currentCompletionData != null)
- args.RetVal = keyHandled = await CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
+ args.RetVal = keyHandled = CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
}
void OnEditFocusOut (object sender, FocusOutEventArgs args)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs
index 7cc909f4e7..d585400e73 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs
@@ -76,7 +76,7 @@ namespace MonoDevelop.Debugger
double typeColWidth;
readonly CellRendererTextWithIcon crtExp;
- readonly CellRendererText crtValue;
+ readonly ValueCellRenderer crtValue;
readonly CellRendererText crtType;
readonly CellRendererRoundedButton crpButton;
readonly CellRendererImage crpPin;
@@ -178,7 +178,10 @@ namespace MonoDevelop.Debugger
}
}
- class CellRendererTextUrl : CellRendererText{
+ class ValueCellRenderer : CellRendererText
+ {
+ public bool Compact;
+
[GLib.Property ("texturl")]
public string TextUrl {
get {
@@ -195,6 +198,15 @@ namespace MonoDevelop.Debugger
Text = value;
}
}
+
+ public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
+ {
+ if (Compact)
+ this.Ellipsize = Pango.EllipsizeMode.None;
+ base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height);
+ if (Compact)
+ this.Ellipsize = Pango.EllipsizeMode.End;
+ }
}
class CellRendererColorPreview : CellRenderer
@@ -329,26 +341,7 @@ namespace MonoDevelop.Debugger
valueCol.AddAttribute (evaluateStatusCell, "image", EvaluateStatusIconColumn);
var crColorPreview = new CellRendererColorPreview ();
valueCol.PackStart (crColorPreview, false);
- valueCol.SetCellDataFunc (crColorPreview, new TreeCellDataFunc ((tree_column, cell, model, iter) => {
- var val = (ObjectValue) model.GetValue (iter, ObjectColumn);
- Xwt.Drawing.Color? color;
-
- if (val != null && !val.IsNull && DebuggingService.HasGetConverter<Xwt.Drawing.Color> (val)) {
- try {
- color = DebuggingService.GetGetConverter<Xwt.Drawing.Color> (val).GetValue (val);
- } catch (Exception) {
- color = null;
- }
- } else {
- color = null;
- }
- if (color != null) {
- ((CellRendererColorPreview) cell).Color = (Xwt.Drawing.Color) color;
- cell.Visible = true;
- } else {
- cell.Visible = false;
- }
- }));
+ valueCol.SetCellDataFunc (crColorPreview, ValueDataFunc);
crpButton = new CellRendererRoundedButton ();
valueCol.PackStart (crpButton, false);
valueCol.AddAttribute (crpButton, "visible", ValueButtonVisibleColumn);
@@ -357,7 +350,8 @@ namespace MonoDevelop.Debugger
crpViewer.Image = ImageService.GetIcon (Stock.Edit, IconSize.Menu);
valueCol.PackStart (crpViewer, false);
valueCol.AddAttribute (crpViewer, "visible", ViewerButtonVisibleColumn);
- crtValue = new CellRendererTextUrl ();
+ crtValue = new ValueCellRenderer ();
+ crtValue.Ellipsize = Pango.EllipsizeMode.End;
valueCol.PackStart (crtValue, true);
valueCol.AddAttribute (crtValue, "texturl", ValueColumn);
valueCol.AddAttribute (crtValue, "editable", ValueEditableColumn);
@@ -403,9 +397,7 @@ namespace MonoDevelop.Debugger
crtValue.EditingStarted += OnValueEditing;
crtValue.Edited += OnValueEdited;
crtValue.EditingCanceled += OnEditingCancelled;
-
- this.EnableAutoTooltips ();
-
+
createMsg = GettextCatalog.GetString ("Click here to add a new watch");
CompletionWindowManager.WindowClosed += HandleCompletionWindowClosed;
PreviewWindowManager.WindowClosed += HandlePreviewWindowClosed;
@@ -418,6 +410,28 @@ namespace MonoDevelop.Debugger
focus_line_width = (int)this.StyleGetProperty ("focus-line-width") * 2;//we just use *2 version in GetMaxWidth
}
+ static void ValueDataFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ {
+ var val = (ObjectValue)model.GetValue (iter, ObjectColumn);
+ Xwt.Drawing.Color? color;
+
+ if (val != null && !val.IsNull && DebuggingService.HasGetConverter<Xwt.Drawing.Color> (val)) {
+ try {
+ color = DebuggingService.GetGetConverter<Xwt.Drawing.Color> (val).GetValue (val);
+ } catch (Exception) {
+ color = null;
+ }
+ } else {
+ color = null;
+ }
+ if (color != null) {
+ ((CellRendererColorPreview)cell).Color = (Xwt.Drawing.Color)color;
+ cell.Visible = true;
+ } else {
+ cell.Visible = false;
+ }
+ }
+
int expanderSize;
int horizontal_separator;
int grid_line_width;
@@ -748,6 +762,7 @@ namespace MonoDevelop.Debugger
newFont = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12);
valueCol.MaxWidth = int.MaxValue;
}
+ crtValue.Compact = compact;
typeCol.Visible = !compact;
crtExp.FontDesc = newFont;
crtValue.FontDesc = newFont;
@@ -1515,10 +1530,10 @@ namespace MonoDevelop.Debugger
EndEditing (this, EventArgs.Empty);
}
- async void OnEditKeyRelease (object sender, EventArgs e)
+ void OnEditKeyRelease (object sender, EventArgs e)
{
if (!wasHandled) {
- await CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifierState));
+ CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifierState));
PopupCompletion ((Entry) sender);
}
}
@@ -1531,7 +1546,7 @@ namespace MonoDevelop.Debugger
uint keyValue;
[GLib.ConnectBeforeAttribute]
- async void OnEditKeyPress (object s, KeyPressEventArgs args)
+ void OnEditKeyPress (object s, KeyPressEventArgs args)
{
wasHandled = false;
key = args.Event.Key;
@@ -1540,7 +1555,7 @@ namespace MonoDevelop.Debugger
keyValue = args.Event.KeyValue;
if (currentCompletionData != null) {
- wasHandled = await CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifierState));
+ wasHandled = CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifierState));
args.RetVal = wasHandled;
}
}
@@ -1591,13 +1606,8 @@ namespace MonoDevelop.Debugger
if (obj.IsNull)
return false;
if (obj.IsPrimitive) {
- if (obj.TypeName != "string") {
- return false;
- } else {
- if (obj.Value.Length < DebuggingService.DebuggerSession.EvaluationOptions.EllipsizedLength + 3) {//3=2x"(qoute) and 1x "…"
- return false;
- }
- }
+ //obj.DisplayValue.Contains ("|") is special case to detect enum with [Flags]
+ return obj.TypeName == "string" || obj.DisplayValue.Contains ("|");
}
if (string.IsNullOrEmpty (obj.TypeName))
return false;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
index 3e46fd0f6d..c371e943ae 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
@@ -42,6 +42,8 @@ using MonoDevelop.Components.Commands;
using Stock = MonoDevelop.Ide.Gui.Stock;
using MonoDevelop.Components;
using System.Linq;
+using MonoDevelop.Components.AutoTest;
+using System.ComponentModel;
namespace MonoDevelop.Debugger
{
@@ -91,6 +93,9 @@ namespace MonoDevelop.Debugger
this.ShadowType = ShadowType.None;
store = new ListStore (typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(Pango.Style), typeof(object), typeof(int), typeof(bool));
+ SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Icon", "store__Method","store_File",
+ "store_Lang", "store_Addr", "store_Foreground", "store_Style", "store_Frame", "store_FrameIndex");
+ TypeDescriptor.AddAttributes (store, modelAttr);
tree = new PadTreeView (store);
tree.RulesHint = true;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs
index d4f4f51226..c1c386b493 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs
@@ -63,7 +63,7 @@ namespace MonoDevelop.Debugger
{
ExceptionCaughtDialog = new ExceptionCaughtDialogStyle ();
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light) {
ObjectValueTreeValuesButtonBackground = Color.FromName ("#e9f2fc");
ObjectValueTreeValuesButtonText = Color.FromName ("#5294eb");
ObjectValueTreeValuesButtonBorder = Color.FromName ("#5294eb");
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs
index f36d1000b8..108ea39c90 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs
@@ -66,7 +66,7 @@ namespace MonoDevelop.Debugger
}
[GLib.ConnectBeforeAttribute]
- async void HandleKeyPressEvent (object o, Gtk.KeyPressEventArgs args)
+ void HandleKeyPressEvent (object o, Gtk.KeyPressEventArgs args)
{
keyHandled = false;
@@ -80,17 +80,17 @@ namespace MonoDevelop.Debugger
}
if (list != null)
- args.RetVal = keyHandled = await CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
+ args.RetVal = keyHandled = CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
}
- async void HandleKeyReleaseEvent (object o, Gtk.KeyReleaseEventArgs args)
+ void HandleKeyReleaseEvent (object o, Gtk.KeyReleaseEventArgs args)
{
if (keyHandled)
return;
string text = ctx == null ? Text : Text.Substring (Math.Max (0, Math.Min (ctx.TriggerOffset, Text.Length)));
CompletionWindowManager.UpdateWordSelection (text);
- await CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
+ CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
PopupCompletion ();
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
index 9fa65e2afc..93e504e2a2 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
@@ -37,7 +37,8 @@ using MonoDevelop.Components;
using Mono.Debugging.Client;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide;
-
+using MonoDevelop.Components.AutoTest;
+using System.ComponentModel;
namespace MonoDevelop.Debugger
{
@@ -81,6 +82,9 @@ namespace MonoDevelop.Debugger
this.ShadowType = ShadowType.None;
store = new TreeStore (typeof(string), typeof (string), typeof(string), typeof(object), typeof(int), typeof(string));
+ SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Icon", "store__Id","store_Name",
+ "store_Object", "store_Weight", "store_Location");
+ TypeDescriptor.AddAttributes (store, modelAttr);
tree = new PadTreeView (store);
tree.RulesHint = true;
@@ -203,7 +207,7 @@ namespace MonoDevelop.Debugger
foreach (var thread in threads) {
ThreadInfo activeThread = DebuggingService.DebuggerSession.ActiveThread;
- var name = thread.Name == null && thread.Id == 1 ? "Main Thread" : thread.Name;
+ var name = thread.Name == null && thread.Id == 1 ? GettextCatalog.GetString("Main Thread") : thread.Name;
var weight = thread == activeThread ? Pango.Weight.Bold : Pango.Weight.Normal;
var icon = thread == activeThread ? Gtk.Stock.GoForward : null;
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs
index 50cb4254fe..5ee640bc44 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs
@@ -1,249 +1,249 @@
-// ProjectFileDescriptor.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.ComponentModel;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using System.Linq;
-
-namespace MonoDevelop.DesignerSupport
-{
- class ProjectFileDescriptor: CustomDescriptor, IDisposable
- {
- ProjectFile file;
- Project project;
-
- public ProjectFileDescriptor (ProjectFile file)
- {
- this.file = file;
- project = file.Project;
- if (project != null) {
- project.FilePropertyChangedInProject += OnFilePropertyChangedInProject;
- }
- }
-
- void OnFilePropertyChangedInProject (object sender, ProjectFileEventArgs args)
- {
- var pad = IdeApp.Workbench.GetPad <PropertyPad> ();
- if (pad == null)
- return;
-
- var grid = ((PropertyPad)pad.Content).PropertyGrid;
- if (args.Any (arg => arg.ProjectFile == file))
- grid.Refresh ();
- }
-
- void IDisposable.Dispose ()
- {
- if (project != null) {
- project.FilePropertyChangedInProject -= OnFilePropertyChangedInProject;
- project = null;
- }
- }
-
- [LocalizedCategory ("Misc")]
- [LocalizedDisplayName ("Name")]
- [LocalizedDescription ("Name of the file.")]
- public string Name {
- get { return System.IO.Path.GetFileName (file.Name); }
- }
-
- [LocalizedCategory ("Misc")]
- [LocalizedDisplayName ("Path")]
- [LocalizedDescription ("Full path of the file.")]
- public string Path {
- get { return file.FilePath; }
- }
-
- [LocalizedCategory ("Misc")]
- [LocalizedDisplayName ("Type")]
- [LocalizedDescription ("Type of the file.")]
- public string FileType {
- get {
- string type = DesktopService.GetMimeTypeForUri (file.Name);
- return DesktopService.GetMimeTypeDescription (type);
- }
- }
-
- [LocalizedCategory ("Build")]
- [LocalizedDisplayName ("Build action")]
- [LocalizedDescription ("Action to perform when building this file.")]
- [TypeConverter (typeof (BuildActionStringsConverter))]
- [RefreshProperties(RefreshProperties.All)]
- public string BuildAction {
- get { return file.BuildAction; }
- set { file.BuildAction = value; }
- }
-
- [LocalizedCategory ("Build")]
- [LocalizedDisplayName ("Resource ID")]
- [LocalizedDescription ("Identifier of the embedded resource.")]
- public string ResourceId {
- get { return file.ResourceId; }
- set { file.ResourceId = value; }
- }
-
- [LocalizedCategory ("Build")]
- [LocalizedDisplayName ("Copy to output directory")]
- [LocalizedDescription ("Whether to copy the file to the project's output directory when the project is built.")]
- public FileCopyMode CopyToOutputDirectory {
- get { return file.CopyToOutputDirectory; }
- set { file.CopyToOutputDirectory = value; }
- }
-
- [LocalizedCategory ("Build")]
- [LocalizedDisplayName ("Custom Tool")]
- [LocalizedDescription ("The ID of a custom code generator.")]
- public string Generator {
- get { return file.Generator; }
- set { file.Generator = value; }
- }
-
- [LocalizedCategory ("Build")]
- [LocalizedDisplayName ("Custom Tool Namespace")]
- [LocalizedDescription ("Overrides the namespace in which the custom code generator should generate code.")]
- public string CustomToolNamespace {
- get { return file.CustomToolNamespace; }
- set { file.CustomToolNamespace = value; }
- }
-
- protected override bool IsReadOnly (string propertyName)
- {
- return false;
- }
-
- [MonoDevelop.Components.PropertyGrid.PropertyEditors.StandardValuesSeparator ("--")]
- class BuildActionStringsConverter : StandardStringsConverter
- {
- public override System.Collections.ICollection GetStandardStrings (ITypeDescriptorContext context)
- {
- ProjectFileDescriptor descriptor = context != null?
- context.Instance as ProjectFileDescriptor : null;
-
- if (descriptor != null && descriptor.file != null && descriptor.file.Project != null) {
- return descriptor.file.Project.GetBuildActions ();
- } else {
- return new string[] {"Content", "None", "Compile"};
- }
- }
-
- public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
- {
- return destinationType == typeof (string);
- }
-
- public override object ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
- {
- return (string)value;
- }
-
- public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+// ProjectFileDescriptor.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.ComponentModel;
+
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using System.Linq;
+
+namespace MonoDevelop.DesignerSupport
+{
+ class ProjectFileDescriptor: CustomDescriptor, IDisposable
+ {
+ ProjectFile file;
+ Project project;
+
+ public ProjectFileDescriptor (ProjectFile file)
+ {
+ this.file = file;
+ project = file.Project;
+ if (project != null) {
+ project.FilePropertyChangedInProject += OnFilePropertyChangedInProject;
+ }
+ }
+
+ void OnFilePropertyChangedInProject (object sender, ProjectFileEventArgs args)
+ {
+ var pad = IdeApp.Workbench.GetPad <PropertyPad> ();
+ if (pad == null)
+ return;
+
+ var grid = ((PropertyPad)pad.Content).PropertyGrid;
+ if (args.Any (arg => arg.ProjectFile == file))
+ grid.Populate (saveEditSession: false);
+ }
+
+ void IDisposable.Dispose ()
+ {
+ if (project != null) {
+ project.FilePropertyChangedInProject -= OnFilePropertyChangedInProject;
+ project = null;
+ }
+ }
+
+ [LocalizedCategory ("Misc")]
+ [LocalizedDisplayName ("Name")]
+ [LocalizedDescription ("Name of the file.")]
+ public string Name {
+ get { return System.IO.Path.GetFileName (file.Name); }
+ }
+
+ [LocalizedCategory ("Misc")]
+ [LocalizedDisplayName ("Path")]
+ [LocalizedDescription ("Full path of the file.")]
+ public string Path {
+ get { return file.FilePath; }
+ }
+
+ [LocalizedCategory ("Misc")]
+ [LocalizedDisplayName ("Type")]
+ [LocalizedDescription ("Type of the file.")]
+ public string FileType {
+ get {
+ string type = DesktopService.GetMimeTypeForUri (file.Name);
+ return DesktopService.GetMimeTypeDescription (type);
+ }
+ }
+
+ [LocalizedCategory ("Build")]
+ [LocalizedDisplayName ("Build action")]
+ [LocalizedDescription ("Action to perform when building this file.")]
+ [TypeConverter (typeof (BuildActionStringsConverter))]
+ [RefreshProperties(RefreshProperties.All)]
+ public string BuildAction {
+ get { return file.BuildAction; }
+ set { file.BuildAction = value; }
+ }
+
+ [LocalizedCategory ("Build")]
+ [LocalizedDisplayName ("Resource ID")]
+ [LocalizedDescription ("Identifier of the embedded resource.")]
+ public string ResourceId {
+ get { return file.ResourceId; }
+ set { file.ResourceId = value; }
+ }
+
+ [LocalizedCategory ("Build")]
+ [LocalizedDisplayName ("Copy to output directory")]
+ [LocalizedDescription ("Whether to copy the file to the project's output directory when the project is built.")]
+ public FileCopyMode CopyToOutputDirectory {
+ get { return file.CopyToOutputDirectory; }
+ set { file.CopyToOutputDirectory = value; }
+ }
+
+ [LocalizedCategory ("Build")]
+ [LocalizedDisplayName ("Custom Tool")]
+ [LocalizedDescription ("The ID of a custom code generator.")]
+ public string Generator {
+ get { return file.Generator; }
+ set { file.Generator = value; }
+ }
+
+ [LocalizedCategory ("Build")]
+ [LocalizedDisplayName ("Custom Tool Namespace")]
+ [LocalizedDescription ("Overrides the namespace in which the custom code generator should generate code.")]
+ public string CustomToolNamespace {
+ get { return file.CustomToolNamespace; }
+ set { file.CustomToolNamespace = value; }
+ }
+
+ protected override bool IsReadOnly (string propertyName)
+ {
+ return false;
+ }
+
+ [MonoDevelop.Components.PropertyGrid.PropertyEditors.StandardValuesSeparator ("--")]
+ class BuildActionStringsConverter : StandardStringsConverter
+ {
+ public override System.Collections.ICollection GetStandardStrings (ITypeDescriptorContext context)
+ {
+ ProjectFileDescriptor descriptor = context != null?
+ context.Instance as ProjectFileDescriptor : null;
+
+ if (descriptor != null && descriptor.file != null && descriptor.file.Project != null) {
+ return descriptor.file.Project.GetBuildActions ();
+ } else {
+ return new string[] {"Content", "None", "Compile"};
+ }
+ }
+
+ public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+ {
+ return destinationType == typeof (string);
+ }
+
+ public override object ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
+ {
+ return (string)value;
+ }
+
+ public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+ {
+ return sourceType == typeof (string);
+ }
+
+ public override object ConvertFrom (ITypeDescriptorContext context,
+ System.Globalization.CultureInfo culture, object value)
{
- return sourceType == typeof (string);
- }
-
- public override object ConvertFrom (ITypeDescriptorContext context,
- System.Globalization.CultureInfo culture, object value)
+ if (!IsValid (context, value))
+ throw new FormatException ("Invalid build target name");
+
+ return (string)value;
+ }
+
+ public override bool IsValid (ITypeDescriptorContext context, object value)
{
- if (!IsValid (context, value))
- throw new FormatException ("Invalid build target name");
+ if (!(value is string))
+ return false;
- return (string)value;
- }
-
- public override bool IsValid (ITypeDescriptorContext context, object value)
- {
- if (!(value is string))
- return false;
-
- string str = (string) value;
- if (string.IsNullOrEmpty (str) || !char.IsLetter (str[0]))
- return false;
-
- for (int i = 1; i < str.Length; i++) {
- char c = str[i];
- if (char.IsLetterOrDigit (c) || c == '_')
- continue;
- else
- return false;
- }
-
- return true;
- }
- public override bool GetStandardValuesExclusive (ITypeDescriptorContext context)
- {
- return false;
- }
- }
-
+ string str = (string) value;
+ if (string.IsNullOrEmpty (str) || !char.IsLetter (str[0]))
+ return false;
+
+ for (int i = 1; i < str.Length; i++) {
+ char c = str[i];
+ if (char.IsLetterOrDigit (c) || c == '_')
+ continue;
+ else
+ return false;
+ }
+
+ return true;
+ }
+ public override bool GetStandardValuesExclusive (ITypeDescriptorContext context)
+ {
+ return false;
+ }
+ }
+
abstract class StandardStringsConverter : TypeConverter
{
- public override bool GetStandardValuesSupported (ITypeDescriptorContext context)
+ public override bool GetStandardValuesSupported (ITypeDescriptorContext context)
{
- return true;
+ return true;
}
- public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+ public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
{
- return sourceType == typeof (string) || base.CanConvertFrom (context, sourceType);
+ return sourceType == typeof (string) || base.CanConvertFrom (context, sourceType);
}
- public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
- {
- return destinationType == typeof (string) || base.CanConvertTo (context, destinationType);
+ public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+ {
+ return destinationType == typeof (string) || base.CanConvertTo (context, destinationType);
}
- public override object ConvertFrom (ITypeDescriptorContext context,
- System.Globalization.CultureInfo culture, object value)
+ public override object ConvertFrom (ITypeDescriptorContext context,
+ System.Globalization.CultureInfo culture, object value)
{
- if (value != null && value is string)
- return value;
- else
- return base.ConvertFrom (context, culture, value);
+ if (value != null && value is string)
+ return value;
+ else
+ return base.ConvertFrom (context, culture, value);
}
- public override object ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture,
- object value, Type destinationType)
- {
- if (value != null && (destinationType == typeof (string)))
- return value;
- else
- return base.ConvertTo (context, culture, value, destinationType);
+ public override object ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture,
+ object value, Type destinationType)
+ {
+ if (value != null && (destinationType == typeof (string)))
+ return value;
+ else
+ return base.ConvertTo (context, culture, value, destinationType);
}
- public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
- {
- return new StandardValuesCollection (GetStandardStrings (context));
+ public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
+ {
+ return new StandardValuesCollection (GetStandardStrings (context));
}
public abstract System.Collections.ICollection GetStandardStrings (ITypeDescriptorContext context);
- }
- }
-}
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs
index b5181eed6b..b49a661802 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs
@@ -41,7 +41,19 @@ namespace MonoDevelop.DesignerSupport.Projects
{
this.pref = pref;
}
-
+
+ [LocalizedCategory ("Reference")]
+ [LocalizedDisplayName ("Aliases")]
+ [LocalizedDescription ("A comma delimited list of aliases applied to this reference.")]
+ public string Aliases {
+ get {
+ return pref.Aliases;
+ }
+ set {
+ pref.Aliases = value;
+ }
+ }
+
[LocalizedCategory ("Reference")]
[LocalizedDisplayName ("Type")]
[LocalizedDescription ("Type of the reference.")]
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 5f2514e67b..5ed2482524 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs
@@ -31,6 +31,7 @@ using MonoDevelop.Ide.CodeTemplates;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.DesignerSupport.Toolbox
{
@@ -42,18 +43,20 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public System.Collections.Generic.IEnumerable<ItemToolboxNode> GetDynamicItems (IToolboxConsumer consumer)
{
- var editor = consumer as IReadonlyTextDocument;
- if (editor != null) {
- foreach (CodeTemplate ct in CodeTemplateService.GetCodeTemplatesForFile (editor.FileName)) {
- if (ct.CodeTemplateContext != CodeTemplateContext.Standard)
- continue;
- yield return new TemplateToolboxNode (ct) {
- Category = category,
- Icon = ImageService.GetIcon ("md-template", Gtk.IconSize.Menu)
- };
- }
+ var content = consumer as ViewContent;
+ if (content == null || !content.IsFile)
+ yield break;
+ // Hack: Ensure that this category is only filled if the current page is a text editor.
+ if (!(content is ITextEditorResolver))
+ yield break;
+ foreach (CodeTemplate ct in CodeTemplateService.GetCodeTemplatesForFile (content.ContentName)) {
+ if (ct.CodeTemplateContext != CodeTemplateContext.Standard)
+ continue;
+ yield return new TemplateToolboxNode (ct) {
+ Category = category,
+ Icon = ImageService.GetIcon ("md-template", Gtk.IconSize.Menu)
+ };
}
- yield break;
}
public event EventHandler ItemsChanged {
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 2d32c17973..53a79e703d 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs
@@ -34,7 +34,8 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.ProgressMonitoring;
using MonoDevelop.Components;
using MonoDevelop.Ide;
-
+using System.Threading.Tasks;
+
namespace MonoDevelop.DesignerSupport.Toolbox
{
internal partial class ComponentSelectorDialog : Gtk.Dialog
@@ -55,12 +56,8 @@ namespace MonoDevelop.DesignerSupport.Toolbox
bool showCategories;
Dictionary<ItemToolboxNode, ItemToolboxNode> currentItems = new Dictionary<ItemToolboxNode, ItemToolboxNode> ();
- public ComponentSelectorDialog (IToolboxConsumer currentConsumer)
+ public ComponentSelectorDialog ()
{
- using (ProgressMonitor monitor = new MessageDialogProgressMonitor (true, true, false, true)) {
- index = DesignerSupport.Service.ToolboxService.GetComponentIndex (monitor);
- }
-
this.ApplyTheme ();
this.Build();
@@ -106,28 +103,38 @@ namespace MonoDevelop.DesignerSupport.Toolbox
foreach (ItemToolboxNode it in DesignerSupport.Service.ToolboxService.UserItems)
currentItems [it] = it;
-
- List<string> list = new List<string> ();
- foreach (ComponentIndexFile ifile in index.Files) {
- foreach (ItemToolboxNode co in ifile.Components) {
- if (!list.Contains (co.ItemDomain))
- list.Add (co.ItemDomain);
- }
- }
-
- string defaultDomain = null;
- if (currentConsumer != null)
- defaultDomain = currentConsumer.DefaultItemDomain;
-
+
comboType.AppendText (GettextCatalog.GetString ("All"));
comboType.Active = 0;
+ }
- for (int n=0; n<list.Count; n++) {
- string s = list [n];
- comboType.AppendText (s);
- if (s == defaultDomain)
- comboType.Active = n+1;
- }
+ public async Task<bool> Initialize (IToolboxConsumer currentConsumer)
+ {
+ using (ProgressMonitor monitor = new MessageDialogProgressMonitor (true, true, false, true)) {
+ index = await DesignerSupport.Service.ToolboxService.GetComponentIndex (monitor);
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return false;
+ }
+
+ List<string> list = new List<string> ();
+ foreach (ComponentIndexFile ifile in index.Files) {
+ foreach (ItemToolboxNode co in ifile.Components) {
+ if (!list.Contains (co.ItemDomain))
+ list.Add (co.ItemDomain);
+ }
+ }
+
+ string defaultDomain = null;
+ if (currentConsumer != null)
+ defaultDomain = currentConsumer.DefaultItemDomain;
+
+ for (int n = 0; n < list.Count; n++) {
+ string s = list [n];
+ comboType.AppendText (s);
+ if (s == defaultDomain)
+ comboType.Active = n + 1;
+ }
+ return true;
}
public void Fill ()
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 bda69169b5..d0ef7aa78e 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs
@@ -167,9 +167,9 @@ namespace MonoDevelop.DesignerSupport.Toolbox
toolboxWidget.QueueResize ();
}
- void toolboxAddButton_Clicked (object sender, EventArgs e)
+ async void toolboxAddButton_Clicked (object sender, EventArgs e)
{
- toolboxService.AddUserItems ();
+ await toolboxService.AddUserItems ();
}
void ShowPopup (Gdk.EventButton evt)
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/Commands.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/Commands.cs
index 2895795fdb..137de5a6db 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/Commands.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/Commands.cs
@@ -42,9 +42,9 @@ namespace MonoDevelop.DesignerSupport
public class SelectItemsCommandHandler: CommandHandler
{
- protected override void Run ()
+ protected override async void Run ()
{
- MonoDevelop.DesignerSupport.DesignerSupport.Service.ToolboxService.AddUserItems ();
+ await MonoDevelop.DesignerSupport.DesignerSupport.Service.ToolboxService.AddUserItems ();
}
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
index 9ce9320b34..fb18f70238 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
@@ -87,6 +87,7 @@ namespace MonoDevelop.DesignerSupport
public override void Dispose()
{
DesignerSupport.Service.SetPad (null);
+ base.Dispose ();
}
#endregion
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/SwitchBetweenRelatedFilesCommand.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/SwitchBetweenRelatedFilesCommand.cs
index 18653c1b07..2430448a94 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/SwitchBetweenRelatedFilesCommand.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/SwitchBetweenRelatedFilesCommand.cs
@@ -58,7 +58,7 @@ namespace MonoDevelop.DesignerSupport
var files = GetFileGroup (projectFile).ToList ();
for (int i = 0; i < files.Count; i++) {
if (projectFile.Equals (files[i]))
- IdeApp.Workbench.OpenDocument (files[(i+1)%(files.Count)].FilePath, true);
+ IdeApp.Workbench.OpenDocument (files[(i+1)%(files.Count)].FilePath, null, true);
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
index 68c6ddf7f8..502b4418fa 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
@@ -45,7 +45,8 @@ using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
using MonoDevelop.DesignerSupport.Toolbox;
using MonoDevelop.Ide;
-
+using System.Threading.Tasks;
+
namespace MonoDevelop.DesignerSupport
{
public class ToolboxService
@@ -123,9 +124,13 @@ namespace MonoDevelop.DesignerSupport
OnToolboxContentsChanged ();
}
- public void AddUserItems ()
+ public async Task AddUserItems ()
{
- using (ComponentSelectorDialog dlg = new ComponentSelectorDialog (currentConsumer)) {
+ using (ComponentSelectorDialog dlg = new ComponentSelectorDialog ()) {
+ bool initialized = await dlg.Initialize (currentConsumer);
+ if (!initialized)
+ return;
+
dlg.Fill ();
MessageService.ShowCustomDialog (dlg);
}
@@ -541,7 +546,7 @@ namespace MonoDevelop.DesignerSupport
throw new InvalidOperationException ("Unexpected ToolboxItemFilterType value.");
}
- internal ComponentIndex GetComponentIndex (ProgressMonitor monitor)
+ internal async Task<ComponentIndex> GetComponentIndex (ProgressMonitor monitor)
{
// Returns an index of all components that can be added to the toolbox.
@@ -583,13 +588,17 @@ namespace MonoDevelop.DesignerSupport
if (toupdate.Count > 0) {
monitor.BeginTask (GettextCatalog.GetString ("Looking for components..."), toupdate.Count);
LoaderContext ctx = new LoaderContext ();
- try {
- foreach (ComponentIndexFile ia in toupdate) {
- ia.Update (ctx);
- monitor.Step (1);
- if (monitor.CancellationToken.IsCancellationRequested)
- return index;
- }
+ try {
+ await Task.Run (() => {
+ foreach (ComponentIndexFile ia in toupdate) {
+ ia.Update (ctx);
+ monitor.Step (1);
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+ }
+ });
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return index;
} finally {
ctx.Dispose ();
monitor.EndTask ();
@@ -600,8 +609,8 @@ namespace MonoDevelop.DesignerSupport
index.Save ();
return index;
- }
-
+ }
+
#endregion
}
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs
index b73b13086c..7ccb5b775d 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.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 System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
@@ -49,7 +48,7 @@ namespace MonoDevelop.DocFood
return doc.Substring (trimStart).TrimEnd ('\n', '\r');
}
- public override Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
if (descriptor.KeyChar != '/')
return base.KeyPress (descriptor);
@@ -104,7 +103,7 @@ namespace MonoDevelop.DocFood
if (SelectSummary (offset, insertedLength, documentation) == false)
Editor.CaretOffset = offset + insertedLength;
}
- return Task.FromResult (false);
+ return false;
}
/// <summary>
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs
index 60d41c71b3..b2d61ba3d6 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs
@@ -49,7 +49,7 @@ namespace MonoDevelop.Gettext
public static void LoadStyles ()
{
POEditor = new POEditorStyle ();
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.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);
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml
index 60b8901f70..a65c81440e 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml
@@ -86,7 +86,7 @@
</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">
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs
index c2848375cc..a3ec7fe38e 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 MonoDevelop.Ide;
using System.Threading.Tasks;
namespace MonoDevelop.Gettext
@@ -43,6 +44,8 @@ namespace MonoDevelop.Gettext
public async Task<int> Run (string[] arguments)
{
+ DesktopService.Initialize ();
+
Console.WriteLine (BrandingService.BrandApplicationName ("MonoDevelop Gettext Update Tool"));
foreach (string s in arguments)
ReadArgument (s);
diff --git a/main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs b/main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs
index 904938eb23..5f0d806512 100644
--- a/main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs
@@ -6,6 +6,9 @@ using Mono.Addins.Description;
[assembly:Addin ("GtkCore",
Namespace = "MonoDevelop",
Version = MonoDevelop.BuildInfo.Version,
+#if !GNOME
+ EnabledByDefault = false,
+#endif
Category = "IDE extensions")]
[assembly:AddinName ("GTK# Visual Designer")]
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 5eae8f19fd..d472880aeb 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs
@@ -42,7 +42,6 @@ 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;
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 c765892291..f1ada4ce17 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
@@ -176,7 +176,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
file = ActionGroupDisplayBinding.BindToClass (project, group);
}
- Document doc = await IdeApp.Workbench.OpenDocument (file, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (file, null, true);
if (doc != null) {
ActionGroupView view = doc.GetContent<ActionGroupView> ();
if (view != null) {
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 ad6f2b722b..931f55efd7 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs
@@ -93,7 +93,7 @@ namespace MonoDevelop.GtkCore.NodeBuilders
if (w.SourceCodeFile == FilePath.Null && !w.BindToClass ())
return;
- Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, null, true);
if (doc != null) {
GuiBuilderView view = doc.GetContent<GuiBuilderView> ();
if (view != 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 cf1ce14602..21bf56999c 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs
@@ -118,7 +118,7 @@ namespace MonoDevelop.GtkCore.NodeBuilders
if (w.SourceCodeFile == FilePath.Null && !w.BindToClass ())
return;
- Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, null, true);
if (doc != null) {
GuiBuilderView view = doc.GetContent<GuiBuilderView> ();
if (view != null)
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj
index 9b5c179396..dff5e1af6e 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj
@@ -38,6 +38,34 @@
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\build\AddIns\MonoDevelop.GtkCore\MonoDevelop.GtkCore.xml</DocumentationFile>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugGnome|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\build\AddIns\MonoDevelop.GtkCore</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DefineConstants>DEBUG;GNOME</DefineConstants>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\MonoDevelop.GtkCore\MonoDevelop.GtkCore.xml</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseGnome|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>..\..\..\build\AddIns\MonoDevelop.GtkCore</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DefineConstants>GNOME</DefineConstants>
+ <DebugSymbols>true</DebugSymbols>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\MonoDevelop.GtkCore\MonoDevelop.GtkCore.xml</DocumentationFile>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs
index aaea5a60c0..af9444b2a3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.PackageManagement
public static void LoadStyles ()
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light) {
CellBackgroundColor = Ide.Gui.Styles.PadBackground;
} else {
CellBackgroundColor = Xwt.Drawing.Color.FromName ("#3c3c3c");
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 ea3071b6dc..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,7 +27,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
@@ -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/FakePackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepository.cs
index 40e0784039..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
@@ -32,7 +32,7 @@ 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/FakeProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectManager.cs
index eafbdb3e4d..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
@@ -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/MonoDevelopPackageManagerTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerTests.cs
index 56485dbcb8..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
@@ -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 MonoDevelopPackageManager (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.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
index f874ec3852..ffb8d42e5f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
@@ -155,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" />
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs
index 58f84caff8..54553ab561 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using MonoDevelop.Core;
using MonoDevelop.Ide;
using NuGet;
@@ -34,8 +34,8 @@ namespace MonoDevelop.PackageManagement
{
internal class FileConflictResolver : IFileConflictResolver
{
- static AlertButton YesToAllButton = new AlertButton ("Yes to All");
- static AlertButton NoToAllButton = new AlertButton ("No to All");
+ static AlertButton YesToAllButton = new AlertButton (GettextCatalog.GetString ("Yes to All"));
+ static AlertButton NoToAllButton = new AlertButton (GettextCatalog.GetString ("No to All"));
AlertButton[] buttons = new AlertButton[] {
AlertButton.Yes,
@@ -52,7 +52,7 @@ namespace MonoDevelop.PackageManagement
public FileConflictResolution ResolveFileConflict(string message)
{
AlertButton result = MessageService.AskQuestion(
- "File Conflict",
+ GettextCatalog.GetString ("File Conflict"),
message,
NoButtonIndex, // "No" is default accept button.
buttons);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs
index ec94586591..0851e40070 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs
@@ -26,9 +26,7 @@
// 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
@@ -49,5 +47,7 @@ namespace MonoDevelop.PackageManagement
ReinstallPackageOperations GetReinstallPackageOperations (IEnumerable<IPackage> packages);
void RunPackageOperations(IEnumerable<PackageOperation> operations);
+
+ void InstallPackageIntoSolutionRepository (IPackage package);
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs
index 07c1d0f685..63537562d3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Core;
using NuGet;
namespace MonoDevelop.PackageManagement
@@ -92,7 +93,7 @@ namespace MonoDevelop.PackageManagement
}
protected override string StartingMessageFormat {
- get { return "Adding {0}..."; }
+ get { return GettextCatalog.GetString ("Adding {0}..."); }
}
protected override IOpenPackageReadMeMonitor CreateOpenPackageReadMeMonitor (string packageId)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs
index 413649f77d..a5110e4a2e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs
@@ -51,7 +51,8 @@ namespace MonoDevelop.PackageManagement
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;
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs
index 48a8243b4c..ef35018dd2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
@@ -41,7 +41,7 @@ namespace MonoDevelop.PackageManagement
{
var selectedProjects = new PackageManagementSelectedProjects(solution);
string selectionName = selectedProjects.SelectionName;
- Title = String.Format("{0} - Manage Packages", selectionName);
+ Title = GettextCatalog.GetString ("{0} - Manage Packages", selectionName);
}
public string Title { get; private set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs
index e76d8deec2..dd3985fa06 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs
@@ -26,9 +26,7 @@
// 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
@@ -54,7 +52,7 @@ namespace MonoDevelop.PackageManagement
CreateProjectManager();
}
- // <summary>
+ /// <summary>
/// project manager should be created with:
/// local repo = PackageReferenceRepository(projectSystem, sharedRepo)
/// packageRefRepo should have its RegisterIfNecessary() method called before creating the project manager.
@@ -78,9 +76,25 @@ namespace MonoDevelop.PackageManagement
MonoDevelopProjectManager CreateProjectManager(PackageReferenceRepository packageRefRepository)
{
- return new MonoDevelopProjectManager(LocalRepository, PathResolver, projectSystem, 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;
@@ -96,7 +110,7 @@ namespace MonoDevelop.PackageManagement
public void AddPackageReference (IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
{
- var monitor = new RemovedPackageReferenceMonitor(ProjectManager);
+ var monitor = new PackageReferenceMonitor (ProjectManager, this);
using (monitor) {
ProjectManager.AddPackageReference(package.Id, package.Version, ignoreDependencies, allowPrereleaseVersions);
}
@@ -129,6 +143,13 @@ namespace MonoDevelop.PackageManagement
ExecuteUninstall(package);
}
}
+
+ public void InstallPackageIntoSolutionRepository (IPackage package)
+ {
+ if (!LocalRepository.Exists (package)) {
+ ExecuteInstall (package);
+ }
+ }
bool IsPackageReferencedByOtherProjects(IPackage package)
{
@@ -164,7 +185,7 @@ namespace MonoDevelop.PackageManagement
void UpdatePackageReference(IPackage package, bool updateDependencies, bool allowPrereleaseVersions)
{
- var monitor = new RemovedPackageReferenceMonitor(ProjectManager);
+ var monitor = new PackageReferenceMonitor (ProjectManager, this);
using (monitor) {
ProjectManager.UpdatePackageReference(package.Id, package.Version, updateDependencies, allowPrereleaseVersions);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs
index 2679c57a95..3ea935f025 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs
@@ -142,12 +142,13 @@ namespace MonoDevelop.PackageManagement
protected virtual void LogAddedReferenceToProject(string referenceName, string projectName)
{
- DebugLogFormat("Added reference '{0}' to project '{1}'.", referenceName, projectName);
+ string message = GettextCatalog.GetString ("Added reference '{0}' to project '{1}'.", referenceName, projectName);
+ DebugLog (message);
}
- void DebugLogFormat(string format, params object[] args)
+ void DebugLog (string message)
{
- Logger.Log(MessageLevel.Debug, format, args);
+ Logger.Log (MessageLevel.Debug, message);
}
public bool ReferenceExists(string name)
@@ -226,7 +227,8 @@ namespace MonoDevelop.PackageManagement
protected virtual void LogRemovedReferenceFromProject(string referenceName, string projectName)
{
- DebugLogFormat("Removed reference '{0}' from project '{1}'.", referenceName, projectName);
+ string message = GettextCatalog.GetString ("Removed reference '{0}' from project '{1}'.", referenceName, projectName);
+ DebugLog (message);
}
public bool IsSupportedFile(string path)
@@ -334,7 +336,8 @@ namespace MonoDevelop.PackageManagement
protected virtual void LogAddedFileToProject(string fileName, string projectName)
{
- DebugLogFormat("Added file '{0}' to project '{1}'.", fileName, projectName);
+ string message = GettextCatalog.GetString ("Added file '{0}' to project '{1}'.", fileName, projectName);
+ DebugLog (message);
}
public override void DeleteDirectory(string path, bool recursive)
@@ -360,7 +363,8 @@ namespace MonoDevelop.PackageManagement
protected virtual void LogDeletedDirectory(string folder)
{
- DebugLogFormat("Removed folder '{0}'.", folder);
+ string message = GettextCatalog.GetString ("Removed folder '{0}'.", folder);
+ DebugLog (message);
}
void LogDeletedFileInfo(string path)
@@ -376,12 +380,14 @@ namespace MonoDevelop.PackageManagement
protected virtual void LogDeletedFile(string fileName)
{
- DebugLogFormat("Removed file '{0}'.", fileName);
+ string message = GettextCatalog.GetString ("Removed file '{0}'.", fileName);
+ DebugLog (message);
}
protected virtual void LogDeletedFileFromDirectory(string fileName, string directory)
{
- DebugLogFormat("Removed file '{0}' from folder '{1}'.", fileName, directory);
+ string message = GettextCatalog.GetString ("Removed file '{0}' from folder '{1}'.", fileName, directory);
+ DebugLog (message);
}
public void AddFrameworkReference(string name)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs
index 3836dbeff3..d7f9fec845 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs
@@ -26,8 +26,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Collections.Generic;
+using MonoDevelop.Core;
using NuGet;
namespace MonoDevelop.PackageManagement
@@ -78,7 +78,7 @@ namespace MonoDevelop.PackageManagement
void ReportScriptsWillNotBeRun()
{
- string message = "PowerShell scripts will not be run.";
+ string message = GettextCatalog.GetString ("PowerShell scripts will not be run.");
packageManagementEvents.OnPackageOperationMessageLogged(MessageLevel.Warning, message);
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs
index 72697de66c..1bda3c5992 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs
@@ -51,7 +51,7 @@ namespace MonoDevelop.PackageManagement
public PackageManagementProgressMonitor (OutputProgressMonitor consoleMonitor, ProgressMonitor statusMonitor)
{
- AddSlaveMonitor (statusMonitor);
+ AddFollowerMonitor (statusMonitor);
this.consoleMonitor = consoleMonitor;
consoleMonitorReg = consoleMonitor.CancellationToken.Register (OnCancelRequested);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs
index 6e15406495..128412cff8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs
@@ -24,8 +24,6 @@
// 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 MonoDevelop.PackageManagement
@@ -35,8 +33,7 @@ namespace MonoDevelop.PackageManagement
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/RemovedPackageReferenceMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceMonitor.cs
index f5c856a876..732940d0df 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceMonitor.cs
@@ -1,5 +1,5 @@
//
-// RemovedPackageReferenceMonitor.cs
+// PackageReferenceMonitor.cs
//
// Author:
// Matt Ward <ward.matt@gmail.com>
@@ -32,25 +32,36 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- internal class RemovedPackageReferenceMonitor : IDisposable
+ internal class PackageReferenceMonitor : IDisposable
{
IMonoDevelopProjectManager projectManager;
+ IMonoDevelopPackageManager packageManager;
List<IPackage> packagesRemoved = new List<IPackage>();
- public RemovedPackageReferenceMonitor(IMonoDevelopProjectManager projectManager)
+ 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 {
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs
index ff8743c0a1..1eb6775043 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs
@@ -27,6 +27,7 @@
//
using System;
+using MonoDevelop.Core;
using NuGet;
namespace MonoDevelop.PackageManagement
@@ -46,9 +47,9 @@ namespace MonoDevelop.PackageManagement
void GetMessageFormats()
{
- AddingPackageMessageFormat = "Installing...{0}";
- RemovingPackageMessageFormat = "Uninstalling...{0}";
- ManagingPackageMessageFormat = "Managing...{0}";
+ AddingPackageMessageFormat = GettextCatalog.GetString ("Installing...{0}");
+ RemovingPackageMessageFormat = GettextCatalog.GetString ("Uninstalling...{0}");
+ ManagingPackageMessageFormat = GettextCatalog.GetString ("Managing...{0}");
}
public string AddingPackageMessageFormat { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs
index dac4daf34a..776bea11d1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs
@@ -223,7 +223,7 @@ namespace MonoDevelop.PackageManagement
void ThrowPackageNotFoundError(string packageId)
{
- string message = String.Format("Unable to find package '{0}'.", packageId);
+ string message = GettextCatalog.GetString ("Unable to find package '{0}'.", packageId);
throw new ApplicationException(message);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
index 045561ac7f..c88e8e9659 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
@@ -24,9 +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.PackageManagement;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
@@ -36,40 +34,40 @@ namespace MonoDevelop.PackageManagement
public static ProgressMonitorStatusMessage CreateInstallingSinglePackageMessage (string packageId)
{
return new ProgressMonitorStatusMessage (
- GetString ("Adding {0}...", packageId),
- GetString ("{0} successfully added.", packageId),
- GetString ("Could not add {0}.", packageId),
- GetString ("{0} added with warnings.", packageId)
+ GettextCatalog.GetString ("Adding {0}...", packageId),
+ GettextCatalog.GetString ("{0} successfully added.", packageId),
+ GettextCatalog.GetString ("Could not add {0}.", packageId),
+ GettextCatalog.GetString ("{0} added with warnings.", packageId)
);
}
public static ProgressMonitorStatusMessage CreateInstallingProjectTemplatePackagesMessage ()
{
return new ProgressMonitorStatusMessage (
- GetString ("Adding packages..."),
- GetString ("Packages successfully added."),
- GetString ("Could not add packages."),
- GetString ("Packages added with warnings.")
+ GettextCatalog.GetString ("Adding packages..."),
+ GettextCatalog.GetString ("Packages successfully added."),
+ GettextCatalog.GetString ("Could not add packages."),
+ GettextCatalog.GetString ("Packages added with warnings.")
);
}
public static ProgressMonitorStatusMessage CreateInstallingMultiplePackagesMessage (int count)
{
return new ProgressMonitorStatusMessage (
- GetString ("Adding {0} packages...", count),
- GetString ("{0} packages successfully added.", count),
- GetString ("Could not add packages."),
- GetString ("{0} packages added with warnings.", count)
+ GettextCatalog.GetString ("Adding {0} packages...", count),
+ GettextCatalog.GetString ("{0} packages successfully added.", count),
+ GettextCatalog.GetString ("Could not add packages."),
+ GettextCatalog.GetString ("{0} packages added with warnings.", count)
);
}
public static ProgressMonitorStatusMessage CreateUpdatingPackagesInSolutionMessage ()
{
return new ProgressMonitorStatusMessage (
- GetString ("Updating packages in solution..."),
- GetString ("Packages successfully updated."),
- GetString ("Could not update packages."),
- GetString ("Packages updated with warnings.")
+ GettextCatalog.GetString ("Updating packages in solution..."),
+ GettextCatalog.GetString ("Packages successfully updated."),
+ GettextCatalog.GetString ("Could not update packages."),
+ GettextCatalog.GetString ("Packages updated with warnings.")
);
}
@@ -78,18 +76,18 @@ namespace MonoDevelop.PackageManagement
ProgressMonitorStatusMessage message = CreateUpdatingPackagesInSolutionMessage ();
return new UpdatePackagesProgressMonitorStatusMessage (
projects,
- GetString ("Packages are up to date."),
- GetString ("No updates found but warnings were reported."),
+ GettextCatalog.GetString ("Packages are up to date."),
+ GettextCatalog.GetString ("No updates found but warnings were reported."),
message);
}
public static ProgressMonitorStatusMessage CreateUpdatingPackagesInProjectMessage (int count)
{
return new ProgressMonitorStatusMessage (
- GetString ("Updating {0} packages in project...", count),
- GetString ("{0} packages successfully updated.", count),
- GetString ("Could not update packages."),
- GetString ("{0} packages updated with warnings.", count)
+ GettextCatalog.GetString ("Updating {0} packages in project...", count),
+ GettextCatalog.GetString ("{0} packages successfully updated.", count),
+ GettextCatalog.GetString ("Could not update packages."),
+ GettextCatalog.GetString ("{0} packages updated with warnings.", count)
);
}
@@ -98,28 +96,28 @@ namespace MonoDevelop.PackageManagement
ProgressMonitorStatusMessage message = CreateUpdatingPackagesInProjectMessage (count);
return new UpdatePackagesProgressMonitorStatusMessage (
project,
- GetString ("Packages are up to date."),
- GetString ("No updates found but warnings were reported."),
+ GettextCatalog.GetString ("Packages are up to date."),
+ GettextCatalog.GetString ("No updates found but warnings were reported."),
message);
}
public static ProgressMonitorStatusMessage CreateUpdatingPackagesInProjectMessage ()
{
return new ProgressMonitorStatusMessage (
- GetString ("Updating packages in project..."),
- GetString ("Packages successfully updated."),
- GetString ("Could not update packages."),
- GetString ("Packages updated with warnings.")
+ GettextCatalog.GetString ("Updating packages in project..."),
+ GettextCatalog.GetString ("Packages successfully updated."),
+ GettextCatalog.GetString ("Could not update packages."),
+ GettextCatalog.GetString ("Packages updated with warnings.")
);
}
public static ProgressMonitorStatusMessage CreateUpdatingSinglePackageMessage (string packageId)
{
return new ProgressMonitorStatusMessage (
- GetString ("Updating {0}...", packageId),
- GetString ("{0} successfully updated.", packageId),
- GetString ("Could not update {0}.", packageId),
- GetString ("{0} updated with warnings.", packageId)
+ GettextCatalog.GetString ("Updating {0}...", packageId),
+ GettextCatalog.GetString ("{0} successfully updated.", packageId),
+ GettextCatalog.GetString ("Could not update {0}.", packageId),
+ GettextCatalog.GetString ("{0} updated with warnings.", packageId)
);
}
@@ -128,100 +126,90 @@ namespace MonoDevelop.PackageManagement
ProgressMonitorStatusMessage message = CreateUpdatingSinglePackageMessage (packageId);
return new UpdatePackagesProgressMonitorStatusMessage (
project,
- GetString ("{0} is up to date.", packageId),
- GetString ("No update found but warnings were reported."),
+ GettextCatalog.GetString ("{0} is up to date.", packageId),
+ GettextCatalog.GetString ("No update found but warnings were reported."),
message);
}
public static ProgressMonitorStatusMessage CreateRemoveSinglePackageMessage (string packageId)
{
return new ProgressMonitorStatusMessage (
- GetString ("Removing {0}...", packageId),
- GetString ("{0} successfully removed.", packageId),
- GetString ("Could not remove {0}.", packageId),
- GetString ("{0} removed with warnings.", packageId)
+ GettextCatalog.GetString ("Removing {0}...", packageId),
+ GettextCatalog.GetString ("{0} successfully removed.", packageId),
+ GettextCatalog.GetString ("Could not remove {0}.", packageId),
+ GettextCatalog.GetString ("{0} removed with warnings.", packageId)
);
}
public static ProgressMonitorStatusMessage CreateRestoringPackagesInSolutionMessage ()
{
return new ProgressMonitorStatusMessage (
- GetString ("Restoring packages for solution..."),
- GetString ("Packages successfully restored."),
- GetString ("Could not restore packages."),
- GetString ("Packages restored with warnings.")
+ GettextCatalog.GetString ("Restoring packages for solution..."),
+ GettextCatalog.GetString ("Packages successfully restored."),
+ GettextCatalog.GetString ("Could not restore packages."),
+ GettextCatalog.GetString ("Packages restored with warnings.")
);
}
public static ProgressMonitorStatusMessage CreateRestoringPackagesBeforeUpdateMessage ()
{
return new ProgressMonitorStatusMessage (
- GetString ("Restoring packages before update..."),
- GetString ("Packages successfully restored."),
- GetString ("Could not restore packages."),
- GetString ("Packages restored with warnings.")
+ GettextCatalog.GetString ("Restoring packages before update..."),
+ GettextCatalog.GetString ("Packages successfully restored."),
+ GettextCatalog.GetString ("Could not restore packages."),
+ GettextCatalog.GetString ("Packages restored with warnings.")
);
}
public static ProgressMonitorStatusMessage CreateRestoringPackagesInProjectMessage ()
{
return new ProgressMonitorStatusMessage (
- GetString ("Restoring packages for project..."),
- GetString ("Packages successfully restored."),
- GetString ("Could not restore packages."),
- GetString ("Packages restored with warnings.")
+ GettextCatalog.GetString ("Restoring packages for project..."),
+ GettextCatalog.GetString ("Packages successfully restored."),
+ GettextCatalog.GetString ("Could not restore packages."),
+ GettextCatalog.GetString ("Packages restored with warnings.")
);
}
public static ProgressMonitorStatusMessage CreateCheckingPackageCompatibilityMessage ()
{
return new ProgressMonitorStatusMessage (
- GetString ("Checking package compatibility with new target framework..."),
- GetString ("Packages are compatible."),
- GetString ("Could not check package compatibility."),
- GetString ("Package retargeting required.")
+ GettextCatalog.GetString ("Checking package compatibility with new target framework..."),
+ GettextCatalog.GetString ("Packages are compatible."),
+ GettextCatalog.GetString ("Could not check package compatibility."),
+ GettextCatalog.GetString ("Package retargeting required.")
);
}
public static ProgressMonitorStatusMessage CreateRetargetingSinglePackageMessage (string packageId)
{
return new ProgressMonitorStatusMessage (
- GetString ("Retargeting {0}...", packageId),
- GetString ("{0} successfully retargeted.", packageId),
- GetString ("Could not retarget {0}.", packageId),
- GetString ("{0} retargeted with warnings.", packageId)
+ GettextCatalog.GetString ("Retargeting {0}...", packageId),
+ GettextCatalog.GetString ("{0} successfully retargeted.", packageId),
+ GettextCatalog.GetString ("Could not retarget {0}.", packageId),
+ GettextCatalog.GetString ("{0} retargeted with warnings.", packageId)
);
}
public static ProgressMonitorStatusMessage CreateRetargetingPackagesInProjectMessage (int count)
{
return new ProgressMonitorStatusMessage (
- GetString ("Retargeting {0} packages...", count),
- GetString ("{0} packages successfully retargeted.", count),
- GetString ("Could not retarget packages."),
- GetString ("{0} packages retargeted with warnings.", count)
+ GettextCatalog.GetString ("Retargeting {0} packages...", count),
+ GettextCatalog.GetString ("{0} packages successfully retargeted.", count),
+ GettextCatalog.GetString ("Could not retarget packages."),
+ GettextCatalog.GetString ("{0} packages retargeted with warnings.", count)
);
}
public static ProgressMonitorStatusMessage CreateRetargetingPackagesInProjectMessage ()
{
return new ProgressMonitorStatusMessage (
- GetString ("Retargeting packages..."),
- GetString ("Packages successfully retargeted."),
- GetString ("Could not retarget packages."),
- GetString ("Packages retarget with warnings.")
+ GettextCatalog.GetString ("Retargeting packages..."),
+ GettextCatalog.GetString ("Packages successfully retargeted."),
+ GettextCatalog.GetString ("Could not retarget packages."),
+ GettextCatalog.GetString ("Packages retarget with warnings.")
);
}
-
- static string GetString (string phrase)
- {
- return GettextCatalog.GetString (phrase);
- }
-
- static string GetString (string phrase, object arg0)
- {
- return GettextCatalog.GetString (phrase, arg0);
- }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
index ac112b3cf3..d8f5c23b98 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
@@ -137,12 +137,10 @@ namespace MonoDevelop.PackageManagement
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 ("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}");
+ 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 c73487c121..7c7f7ce739 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs
@@ -26,10 +26,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
+using MonoDevelop.Core;
using NuGet;
namespace MonoDevelop.PackageManagement
@@ -37,7 +37,7 @@ namespace MonoDevelop.PackageManagement
internal class RegisteredPackageSources : ObservableCollection<PackageSource>
{
public static readonly string DefaultPackageSourceUrl = "https://www.nuget.org/api/v2/";
- public static readonly string DefaultPackageSourceName = "Official NuGet Gallery";
+ public static readonly string DefaultPackageSourceName = GettextCatalog.GetString ("Official NuGet Gallery");
public static readonly PackageSource DefaultPackageSource =
new PackageSource(DefaultPackageSourceUrl, DefaultPackageSourceName);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs
index 62e5792661..de0211a8fd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs
@@ -57,7 +57,7 @@ namespace MonoDevelop.PackageManagement
}
protected override string StartingMessageFormat {
- get { return "Retargeting {0}..." + Environment.NewLine; }
+ get { return GettextCatalog.GetString ("Retargeting {0}...") + Environment.NewLine; }
}
protected override void ExecuteCore ()
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs
index a10aad464a..eb0c959263 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs
@@ -107,11 +107,9 @@ namespace MonoDevelop.PackageManagement
void LogResult (int totalPackageReferences, int packagesRestored)
{
if (packagesRestored == 0) {
- Log ("All packages are already restored.");
- } else if (packagesRestored == 1) {
- Log (GettextCatalog.GetString ("1 package restored successfully."));
+ Log (GettextCatalog.GetString ("All packages are already restored."));
} else if (packagesRestored > 0) {
- Log (GettextCatalog.GetString ("{0} packages restored successfully.", packagesRestored));
+ Log (GettextCatalog.GetPluralString ("1 package restored successfully.", "{0} packages restored successfully.", packagesRestored, packagesRestored));
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs
index 4015de0434..92eed7f570 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs
@@ -26,9 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-using System.IO;
-using NuGet;
+using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
@@ -64,7 +62,7 @@ namespace MonoDevelop.PackageManagement
}
protected override string StartingMessageFormat {
- get { return "Removing {0}..."; }
+ get { return GettextCatalog.GetString ("Removing {0}..."); }
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs
index 8c6129780f..d6d20036b6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Core;
using NuGet;
namespace MonoDevelop.PackageManagement
@@ -116,12 +117,12 @@ namespace MonoDevelop.PackageManagement
void LogNoUpdatesAvailableForPackage (string packageId)
{
- string message = String.Format ("No updates available for '{0}' in project '{1}'.", packageId, Project.Name);
+ string message = GettextCatalog.GetString ("No updates available for '{0}' in project '{1}'.", packageId, Project.Name);
Logger.Log (MessageLevel.Info, message);
}
protected override string StartingMessageFormat {
- get { return "Updating {0}..."; }
+ get { return GettextCatalog.GetString ("Updating {0}..."); }
}
protected override bool ShouldLogEmptyLineForFinishedAction ()
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs
index 6ff41bc7dc..36c274a81f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs
@@ -223,11 +223,7 @@ namespace MonoDevelop.PackageManagement
void LogPackagesFound (int count)
{
- if (count == 1) {
- Log (GettextCatalog.GetString ("{0} update found.", count));
- } else {
- Log (GettextCatalog.GetString ("{0} updates found.", count));
- }
+ Log (GettextCatalog.GetPluralString ("{0} update found.", "{0} updates found.", count, count));
}
void Log (string message)
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
index 4b13b80f07..0b4a28c8b2 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
@@ -660,7 +660,7 @@ namespace MonoDevelop.CodeActions
if (RefactoringService.OptionSetCreation != null)
documentContext.RoslynWorkspace.Options = RefactoringService.OptionSetCreation (editor, documentContext);
using (var undo = editor.OpenUndoGroup ()) {
- foreach (var operation in act.GetOperationsAsync (token).Result) {
+ foreach (var operation in await act.GetOperationsAsync (token)) {
var applyChanges = operation as ApplyChangesOperation;
if (applyChanges == null) {
operation.Apply (documentContext.RoslynWorkspace, token);
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs
index 1c546dfc66..27a04a9c9c 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs
@@ -39,6 +39,7 @@ using Mono.Addins;
using RefactoringEssentials;
using MonoDevelop.Core.Text;
using System.Linq;
+using System.ComponentModel;
namespace MonoDevelop.CodeActions
{
@@ -101,7 +102,7 @@ namespace MonoDevelop.CodeActions
var actions = new List<ValidCodeAction> ();
if (parsedDocument == null)
return actions;
- var model = parsedDocument.GetAst<SemanticModel> ();
+ var model = await doc.AnalysisDocument.GetSemanticModelAsync (cancellationToken);
if (model == null)
return actions;
var root = await model.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait (false);
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs
index 350c7aba18..b1c7127179 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs
@@ -54,7 +54,7 @@ namespace MonoDevelop.CodeIssues
if (!AnalysisOptions.EnableFancyFeatures || input.Project == null || !input.IsCompileableInProject || input.AnalysisDocument == null)
return Enumerable.Empty<Result> ();
try {
- var model = input.ParsedDocument.GetAst<SemanticModel> ();
+ var model = await analysisDocument.DocumentContext.AnalysisDocument.GetSemanticModelAsync (cancellationToken);
if (model == null)
return Enumerable.Empty<Result> ();
var compilation = model.Compilation;
@@ -90,7 +90,17 @@ namespace MonoDevelop.CodeIssues
var analyzers = System.Collections.Immutable.ImmutableArray<DiagnosticAnalyzer>.Empty.AddRange (providers);
var diagnosticList = new List<Diagnostic> ();
try {
- compilationWithAnalyzer = compilation.WithAnalyzers (analyzers, null, cancellationToken);
+ 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> ();
@@ -124,5 +134,7 @@ namespace MonoDevelop.CodeIssues
return Enumerable.Empty<Result> ();
}
}
+
+
}
} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
index 7533c2d604..68b7e598ad 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
@@ -253,15 +253,7 @@ namespace MonoDevelop.CodeIssues
treeviewInspections.AppendColumn (titleCol);
titleCol.PackStart (toggleRenderer, false);
titleCol.Sizing = TreeViewColumnSizing.Autosize;
- titleCol.SetCellDataFunc (toggleRenderer, delegate (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter) {
- var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)treeStore.GetValue (iter, 1);
- if (provider == null) {
- toggleRenderer.Visible = false;
- return;
- }
- toggleRenderer.Visible = true;
- toggleRenderer.Active = enableState[provider];
- });
+ titleCol.SetCellDataFunc (toggleRenderer, TitleColDataFunc);
var cellRendererText = new CellRendererText {
@@ -317,27 +309,45 @@ namespace MonoDevelop.CodeIssues
} while (comboBoxStore.IterNext (ref storeIter));
};
- col.SetCellDataFunc (comboRenderer, delegate (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter) {
- 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.Value);
- comboRenderer.Icon = GetIcon (severity.Value);
- });
+ col.SetCellDataFunc (comboRenderer, ComboDataFunc);
treeviewInspections.HeadersVisible = false;
treeviewInspections.Model = treeStore;
GetAllSeverities ();
FillInspectors (null);
}
+ // TODO: Make static.
+ void TitleColDataFunc (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)model.GetValue (iter, 1);
+ if (provider == null) {
+ cell.Visible = false;
+ return;
+ }
+ cell.Visible = true;
+ ((CellRendererToggle)cell).Active = enableState [provider];
+ }
+
+ // TODO: Make static.
+ void ComboDataFunc (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)treeStore.GetValue (iter, 1);
+ if (provider == null) {
+ cell.Visible = false;
+ return;
+ }
+ var severity = severities [provider];
+ if (!severity.HasValue) {
+ cell.Visible = false;
+ return;
+ }
+ cell.Visible = true;
+
+ var combo = (CustomCellRenderer)cell;
+ combo.Text = GetDescription (severity.Value);
+ combo.Icon = GetIcon (severity.Value);
+ }
+
void ApplyFilter (object sender, EventArgs e)
{
FillInspectors (searchentryFilter.Entry.Text.Trim ());
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs
index a2e9b91a5e..8306a6ab3c 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs
@@ -87,7 +87,6 @@ namespace MonoDevelop.CodeIssues
}
} catch (Exception e) {
LoggingService.LogError ("Unhandled exception", e);
- MessageService.ShowException (e);
}
}
}
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 44eb9d4af7..bc1fce2131 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameRefactoring.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameRefactoring.cs
@@ -43,6 +43,8 @@ using MonoDevelop.Ide.Editor;
using Microsoft.CodeAnalysis.Rename;
using System.Threading.Tasks;
using System.Threading;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.CSharp;
namespace MonoDevelop.Refactoring.Rename
{
@@ -106,24 +108,41 @@ namespace MonoDevelop.Refactoring.Rename
}
var doc = IdeApp.Workbench.ActiveDocument;
var editor = doc.Editor;
+ var oldVersion = editor.Version;
var links = new List<TextLink> ();
var link = new TextLink ("name");
- 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);
+ var documents = ImmutableHashSet.Create (doc.AnalysisDocument);
+
+ foreach (var loc in symbol.Locations) {
+ if (loc.IsInSource && FilePath.PathComparer.Equals (loc.SourceTree.FilePath, doc.FileName)) {
+ link.AddLink (new TextSegment (loc.SourceSpan.Start, loc.SourceSpan.Length));
}
}
+ foreach (var mref in await SymbolFinder.FindReferencesAsync (symbol, TypeSystemService.Workspace.CurrentSolution, documents, default(CancellationToken))) {
+ foreach (var loc in mref.Locations) {
+ 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;
+ }
+ if (span.Start != loc.Location.SourceSpan.Start) {
+ span = loc.Location.SourceSpan;
+ }
+ var segment = new TextSegment (span.Start, span.Length);
+ if (segment.Offset <= editor.CaretOffset && editor.CaretOffset <= 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) {
@@ -160,18 +179,20 @@ namespace MonoDevelop.Refactoring.Rename
var newSolution = await Renamer.RenameSymbolAsync (ws.CurrentSolution, symbol, properties.NewName, ws.Options);
var changes = new List<Change> ();
-
+ var documents = new List<DocumentId> ();
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
- });
- }
+ documents.AddRange (projectChange.GetChangedDocuments ());
+ }
+ FilterDuplicateLinkedDocs (newSolution, documents);
+ foreach (var changedDoc in documents) {
+ 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
+ });
}
}
@@ -211,7 +232,25 @@ namespace MonoDevelop.Refactoring.Rename
}
return changes;
}
-
+
+ static void FilterDuplicateLinkedDocs (Solution newSolution, List<DocumentId> documents)
+ {
+ foreach (var doc in documents) {
+ var newDoc = newSolution.GetDocument (doc);
+ bool didRemove = false;
+ foreach (var link in newDoc.GetLinkedDocumentIds ()) {
+ if (documents.Contains (link)) {
+ documents.Remove (link);
+ didRemove = true;
+ }
+ }
+ if (didRemove) {
+ FilterDuplicateLinkedDocs (newSolution, documents);
+ return;
+ }
+ }
+ }
+
static string GetFullFileName (string fileName, string oldFullFileName, int tryCount)
{
var name = new StringBuilder (fileName);
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs
index 5f60bf1ec2..aa1d755ce6 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs
@@ -105,7 +105,7 @@ namespace MonoDevelop.Refactoring
if (result.Count > 1) {
result.RemoveAt (result.Count - 1);
NewLineInsertion insertLine;
- var typeSyntaxReference = type.DeclaringSyntaxReferences.FirstOrDefault (r => r.Span.Contains (sourceSpan));
+ var typeSyntaxReference = type.DeclaringSyntaxReferences.FirstOrDefault (r => r.SyntaxTree.FilePath == data.FileName && r.Span.Contains (sourceSpan));
var lineBefore = data.GetLineByOffset (typeSyntaxReference.Span.End).PreviousLine;
if (lineBefore != null && lineBefore.Length == lineBefore.GetIndentation (data).Length) {
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs
index 2684ff57f9..ae8a9e92bb 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs
@@ -140,7 +140,9 @@ namespace MonoDevelop.Refactoring
if (parsedDocument == null)
return ImmutableArray<string>.Empty;
var result = ImmutableArray<string>.Empty.ToBuilder ();
- var sm = parsedDocument.GetAst<SemanticModel> ();
+ var sm = await doc.AnalysisDocument.GetSemanticModelAsync (cancellationToken);
+ if (sm == null)
+ return ImmutableArray<string>.Empty;
var node = (await sm.SyntaxTree.GetRootAsync (cancellationToken).ConfigureAwait (false)).FindNode (TextSpan.FromBounds (offset, offset));
while (node != null) {
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
index 983f776af4..e97a2dbd1b 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
@@ -45,13 +45,14 @@ using Microsoft.CodeAnalysis.Options;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
namespace MonoDevelop.Refactoring
{
public static class RefactoringService
{
internal static Func<TextEditor, DocumentContext, OptionSet> OptionSetCreation;
- static List<FindReferencesProvider> findReferencesProvider = new List<FindReferencesProvider> ();
+ static ImmutableList<FindReferencesProvider> findReferencesProvider = ImmutableList<FindReferencesProvider>.Empty;
static List<JumpToDeclarationHandler> jumpToDeclarationHandler = new List<JumpToDeclarationHandler> ();
static RefactoringService ()
@@ -60,10 +61,10 @@ namespace MonoDevelop.Refactoring
var provider = (FindReferencesProvider) args.ExtensionObject;
switch (args.Change) {
case ExtensionChange.Add:
- findReferencesProvider.Add (provider);
+ findReferencesProvider = findReferencesProvider.Add (provider);
break;
case ExtensionChange.Remove:
- findReferencesProvider.Remove (provider);
+ findReferencesProvider = findReferencesProvider.Remove (provider);
break;
}
});
@@ -191,33 +192,33 @@ namespace MonoDevelop.Refactoring
}
}
-// 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);
-// }
-// });
-// }
+ // 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);
+ // }
+ // });
+ // }
public static MonoDevelop.Ide.Editor.DocumentLocation GetCorrectResolveLocation (IReadonlyTextDocument editor, MonoDevelop.Ide.Editor.DocumentLocation location)
{
@@ -244,15 +245,19 @@ namespace MonoDevelop.Refactoring
var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true);
try {
foreach (var provider in findReferencesProvider) {
- foreach (var result in await provider.FindReferences (documentIdString, hintProject, monitor.CancellationToken)) {
- monitor.ReportResult (result);
+ try {
+ foreach (var result in await provider.FindReferences (documentIdString, hintProject, monitor.CancellationToken)) {
+ monitor.ReportResult (result);
+ }
+ } catch (OperationCanceledException) {
+ return;
+ } catch (Exception ex) {
+ if (monitor != null)
+ monitor.ReportError ("Error finding references", ex);
+ LoggingService.LogError ("Error finding references", ex);
+ findReferencesProvider = findReferencesProvider.Remove (provider);
}
}
- } 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 ();
@@ -266,17 +271,19 @@ namespace MonoDevelop.Refactoring
var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true);
try {
foreach (var provider in findReferencesProvider) {
- foreach (var result in await provider.FindAllReferences (documentIdString, hintProject, monitor.CancellationToken)) {
- monitor.ReportResult (result);
+ try {
+ foreach (var result in await provider.FindAllReferences (documentIdString, hintProject, monitor.CancellationToken)) {
+ monitor.ReportResult (result);
+ }
+ } catch (OperationCanceledException) {
+ return;
+ } catch (Exception ex) {
+ if (monitor != null)
+ monitor.ReportError ("Error finding references", ex);
+ LoggingService.LogError ("Error finding references", ex);
+ findReferencesProvider = findReferencesProvider.Remove (provider);
}
}
- } catch (OperationCanceledException) {
-
- } 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 ();
@@ -285,17 +292,19 @@ namespace MonoDevelop.Refactoring
public static async Task<bool> TryJumpToDeclarationAsync (string documentIdString, Projects.Project hintProject = null, CancellationToken token = default(CancellationToken))
{
- try {
if (hintProject == null)
hintProject = IdeApp.Workbench.ActiveDocument?.Project;
- foreach (var handler in jumpToDeclarationHandler) {
+ 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);
}
- } catch (OperationCanceledException) {
- } catch (Exception ex) {
- LoggingService.LogError ("Error finding references", ex);
}
+
return false;
}
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs
index 918e9e7713..2fef3d01d7 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs
@@ -105,6 +105,8 @@ namespace MonoDevelop.Refactoring
static async Task<RefactoringSymbolInfo> InternalGetSymbolInfoAsync (Microsoft.CodeAnalysis.Document document, int offset, CancellationToken cancellationToken = default (CancellationToken))
{
+ if (document == null)
+ return RefactoringSymbolInfo.Empty;
var unit = await document.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
if (unit != null) {
var root = await unit.SyntaxTree.GetRootAsync (cancellationToken).ConfigureAwait (false);
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs
index fc0e540066..e1a8cfbdc9 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs
+++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs
@@ -91,7 +91,7 @@ namespace MonoDevelop.RegexToolkit
Show ();
}
- void ElementDescriptionFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
+ static void ElementDescriptionFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
string str = (string)model.GetValue (iter, 2);
if (string.IsNullOrEmpty (str)) {
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 26aa51f03f..ad137b3715 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
string schemeName;
ListStore styleStore = new ListStore (typeof (string), typeof (Mono.TextEditor.Highlighting.ColorScheme), typeof(bool));
- Lazy<Gdk.Pixbuf> errorPixbuf = new Lazy<Gdk.Pixbuf> (() => ImageService.GetIcon (Stock.DialogError, IconSize.Menu).ToPixbuf ());
+ static Lazy<Gdk.Pixbuf> errorPixbuf = new Lazy<Gdk.Pixbuf> (() => ImageService.GetIcon (Stock.DialogError, IconSize.Menu).ToPixbuf ());
public HighlightingPanel ()
{
@@ -49,21 +49,26 @@ namespace MonoDevelop.SourceEditor.OptionPanels
var col = new TreeViewColumn ();
var crpixbuf = new CellRendererPixbuf ();
col.PackStart (crpixbuf, false);
- col.SetCellDataFunc (crpixbuf, (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) => {
- var isError = (bool)styleStore.GetValue (iter, 2);
- crpixbuf.Visible = isError;
- crpixbuf.Pixbuf = isError ? errorPixbuf.Value : null;
- });
+ col.SetCellDataFunc (crpixbuf, ImageDataFunc);
var crtext = new CellRendererText ();
col.PackEnd (crtext, true);
col.SetAttributes (crtext, "markup", 0);
styleTreeview.AppendColumn (col);
styleTreeview.Model = styleStore;
schemeName = DefaultSourceEditorOptions.Instance.ColorScheme;
- MonoDevelop.Ide.Gui.Styles.Changed += HandleSkinChanged;
+ MonoDevelop.Ide.Gui.Styles.Changed += HandleThemeChanged;
}
- void HandleSkinChanged (object sender, EventArgs e)
+ static void ImageDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
+ {
+
+ var isError = (bool)tree_model.GetValue (iter, 2);
+ var crpixbuf = (CellRendererPixbuf)cell;
+ crpixbuf.Visible = isError;
+ crpixbuf.Pixbuf = isError ? errorPixbuf.Value : null;
+ }
+
+ void HandleThemeChanged (object sender, EventArgs e)
{
ShowStyles ();
}
@@ -77,7 +82,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
styleStore = null;
}
- MonoDevelop.Ide.Gui.Styles.Changed -= HandleSkinChanged;
+ MonoDevelop.Ide.Gui.Styles.Changed -= HandleThemeChanged;
base.OnDestroyed ();
}
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 3307f2c390..823fc3add0 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs
@@ -38,8 +38,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels
bool showLineNumbers;
- bool underlineErrors;
-
bool highlightMatchingBracket;
bool highlightCurrentLine;
@@ -62,7 +60,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
this.Build();
showLineNumbers = DefaultSourceEditorOptions.Instance.ShowLineNumberMargin;
- underlineErrors = DefaultSourceEditorOptions.Instance.UnderlineErrors;
highlightMatchingBracket = DefaultSourceEditorOptions.Instance.HighlightMatchingBracket;
highlightCurrentLine = DefaultSourceEditorOptions.Instance.HighlightCaretLine;
showRuler = DefaultSourceEditorOptions.Instance.ShowRuler;
@@ -81,14 +78,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels
DefaultSourceEditorOptions.Instance.ShowLineNumberMargin = this.showLineNumbersCheckbutton.Active;
};
- this.underlineErrorsCheckbutton.Active = underlineErrors = DefaultSourceEditorOptions.Instance.UnderlineErrors;
- this.underlineErrorsCheckbutton.Toggled += delegate {
- DefaultSourceEditorOptions.Instance.UnderlineErrors = this.underlineErrorsCheckbutton.Active;
- foreach (var doc in IdeApp.Workbench.Documents)
- doc.StartReparseThread ();
-
- };
-
this.highlightMatchingBracketCheckbutton.Active = highlightMatchingBracket = DefaultSourceEditorOptions.Instance.HighlightMatchingBracket;
this.highlightMatchingBracketCheckbutton.Toggled += delegate {
DefaultSourceEditorOptions.Instance.HighlightMatchingBracket = this.highlightMatchingBracketCheckbutton.Active;
@@ -157,7 +146,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels
public virtual void ApplyChanges ()
{
showLineNumbers = this.showLineNumbersCheckbutton.Active;
- underlineErrors = this.underlineErrorsCheckbutton.Active;
highlightMatchingBracket = this.highlightMatchingBracketCheckbutton.Active;
highlightCurrentLine = this.highlightCurrentLineCheckbutton.Active;
showRuler = this.showRulerCheckbutton.Active;
@@ -180,7 +168,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels
protected override void OnDestroyed ()
{
DefaultSourceEditorOptions.Instance.ShowLineNumberMargin = showLineNumbers;
- DefaultSourceEditorOptions.Instance.UnderlineErrors = underlineErrors;
DefaultSourceEditorOptions.Instance.HighlightMatchingBracket = highlightMatchingBracket;
DefaultSourceEditorOptions.Instance.HighlightCaretLine = highlightCurrentLine;
DefaultSourceEditorOptions.Instance.ShowRuler = showRuler;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs
index d3b7c7e3b2..e95767792b 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs
@@ -127,5 +127,10 @@ namespace MonoDevelop.SourceEditor.Wrappers
return false;
return Line.Offset == other.Offset && Line.Length == other.Length;
}
+
+ public override string ToString ()
+ {
+ return string.Format ("[DocumentLineWrapper: Line={0}]", Line);
+ }
}
} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs
index 148b925256..c5d2a2d1e5 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs
@@ -57,8 +57,11 @@ namespace MonoDevelop.SourceEditor.Wrappers
static MonoDevelop.Ide.Editor.TextEditor WrapEditor (MonoTextEditor editor)
{
foreach (var doc in IdeApp.Workbench.Documents) {
- if (doc.FileName == editor.FileName)
- return doc.Editor;
+ var textEditor = doc.Editor;
+ if (textEditor == null)
+ continue;
+ if (textEditor.FileName == editor.FileName)
+ return textEditor;
}
return null;
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
index 27c2595dfe..050df0b9d0 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
@@ -87,7 +87,7 @@ namespace MonoDevelop.SourceEditor
if (bgColor == currentBgColor)
return;
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ if (IdeApp.Preferences.UserInterfaceTheme == Ide.Theme.Light)
oddRowColor = CairoExtensions.ColorGetHex (newBgColor.AddLight (-0.02));
else
oddRowColor = CairoExtensions.ColorGetHex (newBgColor.AddLight (-0.02));
@@ -109,7 +109,7 @@ namespace MonoDevelop.SourceEditor
this.AllowGrow = false;
this.Decorated = false;
- TransientFor = (Gtk.Window) ((Gtk.Widget)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;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
index b8d29bc407..7b83c1a4a4 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
@@ -49,8 +49,7 @@ using MonoDevelop.Ide.Editor.Extension;
using MonoDevelop.Ide.Editor;
using MonoDevelop.Ide.Editor.Highlighting;
using MonoDevelop.SourceEditor.Wrappers;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.SourceEditor
{
class ExtensibleTextEditor : Mono.TextEditor.MonoTextEditor
@@ -110,13 +109,13 @@ namespace MonoDevelop.SourceEditor
this.ext = ext;
}
- public override Task<bool> KeyPress (KeyDescriptor descriptor)
+ 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 Task.FromResult (true);
- return Task.FromResult (false);
+ return true;
+ return false;
}
}
@@ -230,8 +229,8 @@ namespace MonoDevelop.SourceEditor
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);
+ if (!scheme.FitsIdeTheme (IdeApp.Preferences.UserInterfaceTheme))
+ scheme = Ide.Editor.Highlighting.SyntaxModeService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceTheme);
return scheme.Name;
}
@@ -255,7 +254,7 @@ namespace MonoDevelop.SourceEditor
}
}
- Task<bool> ExtensionKeyPress (Gdk.Key key, uint ch, Gdk.ModifierType state)
+ bool ExtensionKeyPress (Gdk.Key key, uint ch, Gdk.ModifierType state)
{
isInKeyStroke = true;
try {
@@ -272,7 +271,7 @@ namespace MonoDevelop.SourceEditor
} finally {
isInKeyStroke = false;
}
- return Task.FromResult (false);
+ return false;
}
void ReportExtensionError (Exception ex)
@@ -329,11 +328,11 @@ namespace MonoDevelop.SourceEditor
}
- protected override async Task<bool> OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.ModifierType state)
+ protected override bool OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.ModifierType state)
{
bool result = true;
if (key == Gdk.Key.Escape) {
- bool b = EditorExtension != null ? await ExtensionKeyPress (key, ch, state) : await 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;
@@ -370,15 +369,15 @@ namespace MonoDevelop.SourceEditor
if (EditorExtension != null) {
if (!DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep) {
using (var undo = Document.OpenUndoGroup ()) {
- if (await ExtensionKeyPress (key, ch, state))
- result = await base.OnIMProcessedKeyPressEvent (key, ch, state);
+ if (ExtensionKeyPress (key, ch, state))
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
}
} else {
- if (await ExtensionKeyPress (key, ch, state))
- result = await base.OnIMProcessedKeyPressEvent (key, ch, state);
+ if (ExtensionKeyPress (key, ch, state))
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
}
} else {
- result = await base.OnIMProcessedKeyPressEvent (key, ch, state);
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
}
if (currentSession != null) {
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
index 561ddbc78a..f31bac3fce 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
@@ -747,7 +747,7 @@ namespace MonoDevelop.SourceEditor
}
lastSaveTimeUtc = File.GetLastWriteTimeUtc (fileName);
try {
- if (attributes != null)
+ if (attributes != null)
DesktopService.SetFileAttributes (fileName, attributes);
} catch (Exception e) {
LoggingService.LogError ("Can't set file attributes", e);
@@ -757,14 +757,17 @@ namespace MonoDevelop.SourceEditor
MessageService.ShowError (GettextCatalog.GetString ("Can't save file - access denied"), e.Message);
}
-// if (encoding != null)
-// se.Buffer.SourceEncoding = encoding;
-// TextFileService.FireCommitCountChanges (this);
-
- ContentName = fileName;
- UpdateMimeType (fileName);
- Document.SetNotDirtyState ();
- IsDirty = false;
+ // if (encoding != null)
+ // se.Buffer.SourceEncoding = encoding;
+ // TextFileService.FireCommitCountChanges (this);
+ await Runtime.RunInMainThread (delegate {
+ Document.FileName = ContentName = fileName;
+ if (Document != null) {
+ UpdateMimeType (fileName);
+ Document.SetNotDirtyState ();
+ }
+ IsDirty = false;
+ });
}
public void InformLoadComplete ()
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 7da2e57e69..740062f8fd 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
@@ -14,8 +14,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels
private global::Gtk.CheckButton showLineNumbersCheckbutton;
- private global::Gtk.CheckButton underlineErrorsCheckbutton;
-
private global::Gtk.CheckButton highlightMatchingBracketCheckbutton;
private global::Gtk.CheckButton highlightCurrentLineCheckbutton;
@@ -84,18 +82,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w2.Expand = false;
w2.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- 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.DrawIndicator = true;
- this.underlineErrorsCheckbutton.UseUnderline = true;
- 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.CanFocus = true;
this.highlightMatchingBracketCheckbutton.Name = "highlightMatchingBracketCheckbutton";
@@ -103,10 +89,10 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w4.Position = 2;
- w4.Expand = false;
- w4.Fill = false;
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.highlightMatchingBracketCheckbutton]));
+ w3.Position = 1;
+ w3.Expand = false;
+ w3.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.highlightCurrentLineCheckbutton = new global::Gtk.CheckButton();
this.highlightCurrentLineCheckbutton.CanFocus = true;
@@ -115,10 +101,10 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w5.Position = 3;
- w5.Expand = false;
- w5.Fill = false;
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.highlightCurrentLineCheckbutton]));
+ w4.Position = 2;
+ w4.Expand = false;
+ w4.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.showRulerCheckbutton = new global::Gtk.CheckButton();
this.showRulerCheckbutton.CanFocus = true;
@@ -127,10 +113,10 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w6.Position = 4;
- w6.Expand = false;
- w6.Fill = false;
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.showRulerCheckbutton]));
+ w5.Position = 3;
+ w5.Expand = false;
+ w5.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.enableAnimationCheckbutton1 = new global::Gtk.CheckButton();
this.enableAnimationCheckbutton1.CanFocus = true;
@@ -139,10 +125,10 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w7.Position = 5;
- w7.Expand = false;
- w7.Fill = false;
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.enableAnimationCheckbutton1]));
+ w6.Position = 4;
+ w6.Expand = false;
+ w6.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.enableHighlightUsagesCheckbutton = new global::Gtk.CheckButton();
this.enableHighlightUsagesCheckbutton.CanFocus = true;
@@ -151,10 +137,10 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w8.Position = 6;
- w8.Expand = false;
- w8.Fill = false;
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.enableHighlightUsagesCheckbutton]));
+ w7.Position = 5;
+ w7.Expand = false;
+ w7.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.drawIndentMarkersCheckbutton = new global::Gtk.CheckButton();
this.drawIndentMarkersCheckbutton.CanFocus = true;
@@ -163,10 +149,10 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w9.Position = 7;
- w9.Expand = false;
- w9.Fill = false;
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.drawIndentMarkersCheckbutton]));
+ w8.Position = 6;
+ w8.Expand = false;
+ w8.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.enableQuickDiffCheckbutton = new global::Gtk.CheckButton();
this.enableQuickDiffCheckbutton.CanFocus = true;
@@ -175,10 +161,10 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w10.Position = 8;
- w10.Expand = false;
- w10.Fill = false;
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.enableQuickDiffCheckbutton]));
+ w9.Position = 7;
+ w9.Expand = false;
+ w9.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.table1 = new global::Gtk.Table(((uint)(4)), ((uint)(4)), false);
this.table1.Name = "table1";
@@ -192,13 +178,13 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w11.TopAttach = ((uint)(3));
- w11.BottomAttach = ((uint)(4));
- w11.LeftAttach = ((uint)(1));
- w11.RightAttach = ((uint)(4));
- w11.XOptions = ((global::Gtk.AttachOptions)(4));
- w11.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1[this.checkbuttonLineEndings]));
+ w10.TopAttach = ((uint)(3));
+ w10.BottomAttach = ((uint)(4));
+ w10.LeftAttach = ((uint)(1));
+ w10.RightAttach = ((uint)(4));
+ w10.XOptions = ((global::Gtk.AttachOptions)(4));
+ w10.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.checkbuttonSpaces = new global::Gtk.CheckButton();
this.checkbuttonSpaces.CanFocus = true;
@@ -207,13 +193,13 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w12.TopAttach = ((uint)(1));
- w12.BottomAttach = ((uint)(2));
- w12.LeftAttach = ((uint)(1));
- w12.RightAttach = ((uint)(4));
- w12.XOptions = ((global::Gtk.AttachOptions)(4));
- w12.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.checkbuttonSpaces]));
+ w11.TopAttach = ((uint)(1));
+ w11.BottomAttach = ((uint)(2));
+ w11.LeftAttach = ((uint)(1));
+ w11.RightAttach = ((uint)(4));
+ w11.XOptions = ((global::Gtk.AttachOptions)(4));
+ w11.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.checkbuttonTabs = new global::Gtk.CheckButton();
this.checkbuttonTabs.CanFocus = true;
@@ -222,41 +208,41 @@ namespace MonoDevelop.SourceEditor.OptionPanels
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]));
- w13.TopAttach = ((uint)(2));
- w13.BottomAttach = ((uint)(3));
- w13.LeftAttach = ((uint)(1));
- w13.RightAttach = ((uint)(4));
- w13.XOptions = ((global::Gtk.AttachOptions)(4));
- w13.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.checkbuttonTabs]));
+ w12.TopAttach = ((uint)(2));
+ w12.BottomAttach = ((uint)(3));
+ w12.LeftAttach = ((uint)(1));
+ w12.RightAttach = ((uint)(4));
+ w12.XOptions = ((global::Gtk.AttachOptions)(4));
+ w12.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.label1 = new global::Gtk.Label();
this.label1.Name = "label1";
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]));
- w14.XOptions = ((global::Gtk.AttachOptions)(4));
- w14.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.label1]));
+ w13.XOptions = ((global::Gtk.AttachOptions)(4));
+ w13.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
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]));
- w15.LeftAttach = ((uint)(1));
- w15.RightAttach = ((uint)(4));
- w15.XOptions = ((global::Gtk.AttachOptions)(4));
- w15.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.showWhitespacesCombobox]));
+ w14.LeftAttach = ((uint)(1));
+ w14.RightAttach = ((uint)(4));
+ w14.XOptions = ((global::Gtk.AttachOptions)(4));
+ w14.YOptions = ((global::Gtk.AttachOptions)(4));
this.vbox3.Add(this.table1);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.table1]));
- w16.Position = 9;
- w16.Fill = false;
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.table1]));
+ w15.Position = 8;
+ w15.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]));
- w18.Position = 1;
- w18.Expand = false;
- w18.Fill = false;
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment1]));
+ w17.Position = 1;
+ w17.Expand = false;
+ w17.Fill = false;
this.Add(this.vbox1);
if ((this.Child != null))
{
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
index 19f98120aa..1146b7c21a 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
@@ -263,7 +263,7 @@
</widget>
</child>
</widget>
- <widget class="Gtk.Bin" id="MonoDevelop.SourceEditor.OptionPanels.MarkerPanel" design-size="383 418">
+ <widget class="Gtk.Bin" id="MonoDevelop.SourceEditor.OptionPanels.MarkerPanel" design-size="416 434">
<property name="MemberName" />
<child>
<widget class="Gtk.VBox" id="vbox1">
@@ -308,22 +308,6 @@
</packing>
</child>
<child>
- <widget class="Gtk.CheckButton" id="underlineErrorsCheckbutton">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">_Underline errors</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</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>
<widget class="Gtk.CheckButton" id="highlightMatchingBracketCheckbutton">
<property name="MemberName" />
<property name="CanFocus">True</property>
@@ -333,7 +317,7 @@
<property name="UseUnderline">True</property>
</widget>
<packing>
- <property name="Position">2</property>
+ <property name="Position">1</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -349,7 +333,7 @@
<property name="UseUnderline">True</property>
</widget>
<packing>
- <property name="Position">3</property>
+ <property name="Position">2</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -365,7 +349,7 @@
<property name="UseUnderline">True</property>
</widget>
<packing>
- <property name="Position">4</property>
+ <property name="Position">3</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -381,7 +365,7 @@
<property name="UseUnderline">True</property>
</widget>
<packing>
- <property name="Position">5</property>
+ <property name="Position">4</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -397,7 +381,7 @@
<property name="UseUnderline">True</property>
</widget>
<packing>
- <property name="Position">6</property>
+ <property name="Position">5</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -413,7 +397,7 @@
<property name="UseUnderline">True</property>
</widget>
<packing>
- <property name="Position">7</property>
+ <property name="Position">6</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -429,7 +413,7 @@
<property name="UseUnderline">True</property>
</widget>
<packing>
- <property name="Position">8</property>
+ <property name="Position">7</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -566,7 +550,7 @@
</child>
</widget>
<packing>
- <property name="Position">9</property>
+ <property name="Position">8</property>
<property name="AutoSize">False</property>
<property name="Fill">False</property>
</packing>
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
index 8d08a3ab21..13cf5e6489 100644
--- a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs
@@ -444,10 +444,11 @@ namespace MonoDevelop.UnitTesting.NUnit
result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Canceled"), null);
}
} finally {
+ // Dispose the runner before the console, to make sure the console is available until the runner is disposed.
+ runner.Dispose ();
if (console != null)
console.Dispose ();
cancelReg.Dispose ();
- runner.Dispose ();
File.Delete (crashLogFile);
}
@@ -502,6 +503,7 @@ namespace MonoDevelop.UnitTesting.NUnit
tcpListener = new MonoDevelop.UnitTesting.NUnit.External.TcpTestListener (localMonitor, suiteName);
cmd.Arguments += " -port=" + tcpListener.Port;
}
+ cmd.WorkingDirectory = Path.GetDirectoryName (AssemblyPath);
// 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
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml
index 74a5657a90..5b90817b8e 100644
--- a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml
@@ -7,8 +7,8 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <ProjectTemplate id = "NUnitProject" resource = "NUnitProject.xpt.xml"/>
- <ProjectTemplate id = "NUnitProjectVBNet" resource = "NUnitProjectVBNet.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.CSharp.NUnitLibraryProject" resource = "NUnitProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.VBNet.NUnitLibraryProject" resource = "NUnitProjectVBNet.xpt.xml"/>
</Extension>
<Extension path = "/MonoDevelop/Ide/FileTemplates">
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs
index 2472998471..2e5ada3a94 100644
--- a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs
@@ -25,27 +25,16 @@
// 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;
@@ -55,18 +44,6 @@ namespace NUnit3Runner
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;
@@ -118,12 +95,22 @@ namespace NUnit3Runner
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"));
+ int r;
+ if (int.TryParse (e.GetAttribute ("failed"), out r))
+ res.Failures = r;
+
+ if (int.TryParse (e.GetAttribute ("skipped"), out r))
+ res.Ignored = r;
+
+ if (int.TryParse (e.GetAttribute ("inconclusive"), out r))
+ res.Inconclusive = r;
+
+ if (int.TryParse (e.GetAttribute ("passed"), out r))
+ res.Passed = r;
+
res.NotRunnable = 0;
- res.Passed = int.Parse (e.GetAttribute ("passed"));
+ res.Errors = 0;
+
} else if (e.LocalName == "test-case") {
var runResult = e.GetAttribute ("result");
if (runResult == "Passed")
@@ -150,7 +137,9 @@ namespace NUnit3Runner
}
}
- res.Time = TimeSpan.FromSeconds (double.Parse (e.GetAttribute ("duration"), CultureInfo.InvariantCulture));
+ double d;
+ if (double.TryParse (e.GetAttribute ("duration"), NumberStyles.Any, CultureInfo.InvariantCulture, out d))
+ res.Time = TimeSpan.FromSeconds (d);
var output = e.SelectSingleNode ("output");
if (output != null) {
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj
index c04f9da8c4..b7079a762f 100644
--- a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj
@@ -30,9 +30,6 @@
</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>
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs
index b085795abe..99cfb26219 100644
--- a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs
@@ -31,16 +31,9 @@ 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;
@@ -55,15 +48,6 @@ namespace NUnit3Runner
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 ();
}
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config
index c2833088b1..e9a17d1a0d 100644
--- a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config
@@ -1,5 +1,4 @@
<?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/Gui/TestChart.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestChart.cs
index 13e923934d..d8cee8af52 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestChart.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestChart.cs
@@ -31,6 +31,7 @@ using System.Collections;
using Gtk;
using Gdk;
using MonoDevelop.Components.Chart;
+using MonoDevelop.Core;
namespace MonoDevelop.UnitTesting
{
@@ -89,14 +90,14 @@ namespace MonoDevelop.UnitTesting
SetAutoScale (AxisDimension.Y, false, true);
StartY = 0;
- serieFailed = new Serie ("Failed tests");
+ serieFailed = new Serie (GettextCatalog.GetString("Failed tests"));
serieFailed.Color = new Cairo.Color (1, 0, 0);
- serieSuccess = new Serie ("Successful tests");
+ serieSuccess = new Serie (GettextCatalog.GetString("Successful tests"));
serieSuccess.Color = new Cairo.Color (0, 0.65, 0);
- serieIgnored = new Serie ("Ignored tests");
+ serieIgnored = new Serie (GettextCatalog.GetString("Ignored tests"));
serieIgnored.Color = new Cairo.Color (0.8, 0.8, 0);
- serieTime = new Serie ("Time");
+ serieTime = new Serie (GettextCatalog.GetString("Time"));
serieTime.Color = new Cairo.Color (0, 0, 1);
UpdateMode ();
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs
index e09a748a95..027f8b4265 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs
@@ -161,7 +161,7 @@ namespace MonoDevelop.UnitTesting
// UnitTestResult res = test.GetLastResult ();
loc = test.SourceCodeLocation;
if (loc != null)
- await IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
+ await IdeApp.Workbench.OpenDocument (loc.FileName, null, loc.Line, loc.Column);
}
[CommandHandler (TestCommands.GoToFailure)]
@@ -175,7 +175,7 @@ namespace MonoDevelop.UnitTesting
if (loc == null)
loc = test.SourceCodeLocation;
if (loc != null)
- await IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
+ await IdeApp.Workbench.OpenDocument (loc.FileName, null, loc.Line, loc.Column);
}
[CommandUpdateHandler (TestCommands.GoToFailure)]
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs
index c207a05218..33ac16a75c 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs
@@ -473,7 +473,7 @@ namespace MonoDevelop.UnitTesting
int line = (int)failuresStore.GetValue (iter, 4);
try {
if (file != null && File.Exists (file)) {
- IdeApp.Workbench.OpenDocument (file, line, -1);
+ IdeApp.Workbench.OpenDocument (file, null, line, -1);
return;
}
} catch (Exception) {
@@ -521,7 +521,7 @@ namespace MonoDevelop.UnitTesting
clipboard.Text = last.StackTrace;
break;
default:
- clipboard.Text = last.Message + Environment.NewLine + "Stack trace:" + Environment.NewLine + last.StackTrace;
+ clipboard.Text = last.Message + Environment.NewLine + GettextCatalog.GetString("Stack trace:") + Environment.NewLine + last.StackTrace;
break;
}
} else {
@@ -544,7 +544,7 @@ namespace MonoDevelop.UnitTesting
clipboard.Text = error.StackTrace;
break;
default:
- clipboard.Text = error.Message + Environment.NewLine + "Stack trace:" + Environment.NewLine + error.StackTrace;
+ clipboard.Text = error.Message + Environment.NewLine + GettextCatalog.GetString("Stack trace:") + Environment.NewLine + error.StackTrace;
break;
}
}
@@ -607,7 +607,7 @@ namespace MonoDevelop.UnitTesting
if (loc == null)
loc = test.SourceCodeLocation;
if (loc != null) {
- IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
+ IdeApp.Workbench.OpenDocument (loc.FileName, null, 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));
@@ -622,7 +622,7 @@ namespace MonoDevelop.UnitTesting
return;
SourceCodeLocation loc = test.SourceCodeLocation;
if (loc != null) {
- IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
+ IdeApp.Workbench.OpenDocument (loc.FileName, null, 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));
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs
index 1831e69db4..8d4e500097 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs
@@ -193,47 +193,47 @@ namespace MonoDevelop.UnitTesting
return;
var menu = new ContextMenu ();
if (unitTest.IsFixture) {
- var menuItem = new ContextMenuItem ("_Run All");
+ var menuItem = new ContextMenuItem (GettextCatalog.GetString("_Run All"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, false).Run;
menu.Add (menuItem);
if (debugModeSet != null) {
- menuItem = new ContextMenuItem ("_Debug All");
+ menuItem = new ContextMenuItem (GettextCatalog.GetString("_Debug All"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, true).Run;
menu.Add (menuItem);
}
- menuItem = new ContextMenuItem ("_Select in Test Pad");
+ menuItem = new ContextMenuItem (GettextCatalog.GetString("_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");
+ var menuItem = new ContextMenuItem (GettextCatalog.GetString("_Run"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, false).Run;
menu.Add (menuItem);
if (debugModeSet != null) {
- menuItem = new ContextMenuItem ("_Debug");
+ menuItem = new ContextMenuItem (GettextCatalog.GetString ("_Debug"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, true).Run;
menu.Add (menuItem);
}
- menuItem = new ContextMenuItem ("_Select in Test Pad");
+ menuItem = new ContextMenuItem (GettextCatalog.GetString ("_Select in Test Pad"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, true).Select;
menu.Add (menuItem);
} else {
- var menuItem = new ContextMenuItem ("_Run All");
+ var menuItem = new ContextMenuItem (GettextCatalog.GetString ("_Run All"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, false).Run;
menu.Add (menuItem);
if (debugModeSet != null) {
- menuItem = new ContextMenuItem ("_Debug All");
+ menuItem = new ContextMenuItem (GettextCatalog.GetString ("_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 = new ContextMenuItem (GettextCatalog.GetString ("_Run"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier + id, project, false).Run;
submenu.Add (menuItem);
if (debugModeSet != null) {
- menuItem = new ContextMenuItem ("_Debug");
+ menuItem = new ContextMenuItem (GettextCatalog.GetString ("_Debug"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier + id, project, true).Run;
submenu.Add (menuItem);
}
@@ -249,7 +249,7 @@ namespace MonoDevelop.UnitTesting
}
}
- menuItem = new ContextMenuItem ("_Select in Test Pad");
+ menuItem = new ContextMenuItem (GettextCatalog.GetString ("_Select in Test Pad"));
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier + id, project, true).Select;
submenu.Add (menuItem);
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 c45f4968fe..0d01cb8abb 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs
@@ -27,11 +27,12 @@ namespace MonoDevelop.WebReferences.Commands
// Check and switch the runtime environment for the current project
if (project.TargetFramework.Id == TargetFrameworkMoniker.NET_1_1)
{
- string question = "The current runtime environment for your project is set to version 1.0.";
- question += "Web Service is not supported in this version.";
- question += "Do you want switch the runtime environment for this project version 2.0 ?";
+ string msg1 = GettextCatalog.GetString ("The current runtime environment for your project is set to version 1.0.");
+ string msg2 = GettextCatalog.GetString ("Web Service is not supported in this version.");
+ string msg3 = GettextCatalog.GetString ("Do you want switch the runtime environment for this project version 2.0?");
+ string question = $"{msg1} {msg2} {msg3}";
- var switchButton = new AlertButton ("_Switch to .NET2");
+ var switchButton = new AlertButton (GettextCatalog.GetString ("_Switch to .NET 2.0"));
if (MessageService.AskQuestion(question, AlertButton.Cancel, switchButton) == switchButton)
project.TargetFramework = Runtime.SystemAssemblyService.GetTargetFramework (TargetFrameworkMoniker.NET_2_0);
else
@@ -48,7 +49,7 @@ namespace MonoDevelop.WebReferences.Commands
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);
+ MessageService.ShowError (GettextCatalog.GetString ("The web reference could not be added"), exception);
} finally {
dialog.Destroy ();
dialog.Dispose ();
@@ -119,7 +120,7 @@ namespace MonoDevelop.WebReferences.Commands
return;
item.Delete();
IdeApp.ProjectOperations.SaveAsync (item.Project);
- IdeApp.Workbench.StatusBar.ShowMessage("Deleted Web Reference " + item.Name);
+ IdeApp.Workbench.StatusBar.ShowMessage(GettextCatalog.GetString ("Deleted Web Reference {0}", item.Name));
}
/// <summary>Execute the command for removing all web references from a project.</summary>
@@ -139,7 +140,7 @@ namespace MonoDevelop.WebReferences.Commands
item.Delete();
IdeApp.ProjectOperations.SaveAsync(project);
- IdeApp.Workbench.StatusBar.ShowMessage("Deleted all Web References");
+ IdeApp.Workbench.StatusBar.ShowMessage(GettextCatalog.GetString ("Deleted all Web References"));
}
[CommandUpdateHandler (WebReferenceCommands.Configure)]
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/Library.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/Library.cs
index 0ad3b75057..7ed8e48a6c 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/Library.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/Library.cs
@@ -71,10 +71,10 @@ namespace MonoDevelop.WebReferences
if (dref == null)
continue;
if (dref is ContractReference) {
- text.AppendFormat ("<b>Service: {0}</b>\n<span size='small'>{1}</span>", Path.GetFileNameWithoutExtension (dref.DefaultFilename), dref.Url);
+ text.AppendFormat ("<b>" + GettextCatalog.GetString ("Service: {0}") + "</b>\n<span size='small'>{1}</span>", Path.GetFileNameWithoutExtension (dref.DefaultFilename), dref.Url);
}
else if (dref is DiscoveryDocumentReference) {
- text.AppendFormat ("<b>Discovery document</b>\n<small>{0}</small>", dref.Url);
+ text.AppendFormat ("<b>" + GettextCatalog.GetString ("Discovery document") + "</b>\n<small>{0}</small>", dref.Url);
}
text.Append ("\n\n");
}
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 2358b38595..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
@@ -43,6 +43,7 @@
<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/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/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/MonoDevelop.TextTemplating/T4FileTemplate.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs
index df1bb81309..8b8562e7fe 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs
@@ -67,7 +67,7 @@ namespace MonoDevelop.TextTemplating
foreach (var err in host.Errors)
LoggingService.LogError ("Error in template generator: {0}", err.ToString());
var firstError = host.Errors.OfType<CompilerError> ().First (f => !f.IsWarning);
- throw new Exception ("Failed to generate file: " + firstError.ErrorText);
+ throw new Exception (GettextCatalog.GetString ("Failed to generate file: {0}", firstError.ErrorText));
}
return output;
}
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs
index 4387d8d872..c9f0f900d1 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs
@@ -65,7 +65,7 @@ namespace MonoDevelop.TextTemplating
}
catch (IOException ex) {
host.Errors.Add (new CompilerError {
- ErrorText = "Could not read input file '" + file.FilePath + "':\n" + ex
+ ErrorText = GettextCatalog.GetString ("Could not read input file '{0}':\n{1}", file.FilePath, ex)
});
return;
}
@@ -101,7 +101,7 @@ namespace MonoDevelop.TextTemplating
}
catch (IOException ex) {
host.Errors.Add (new CompilerError {
- ErrorText = "Could not write output file '" + outputFile + "':\n" + ex
+ ErrorText = GettextCatalog.GetString ("Could not write output file '{0}':\n{1}", outputFile, ex)
});
}
}
diff --git a/main/src/addins/TextTemplating/TextTransform/TextTransform.cs b/main/src/addins/TextTemplating/TextTransform/TextTransform.cs
index 0da1987657..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 },
@@ -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/VBNetBinding.addin.xml b/main/src/addins/VBNetBinding/VBNetBinding.addin.xml
index e2dfda72f9..fd4b3c11dc 100644
--- a/main/src/addins/VBNetBinding/VBNetBinding.addin.xml
+++ b/main/src/addins/VBNetBinding/VBNetBinding.addin.xml
@@ -23,9 +23,9 @@
</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">
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 e7a6795dab..0186ad50d8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs
@@ -53,6 +53,7 @@ namespace MonoDevelop.VersionControl.Git.Tests
// Check out the repository.
Checkout (LocalPath, RemoteUrl);
Repo = GetRepo (LocalPath, RemoteUrl);
+ ((GitRepository)Repo).RootRepository.Config.Set ("core.ignorecase", false);
ModifyPath (Repo, ref LocalPath);
DotDir = ".git";
}
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 fb87ce7cf4..787a123091 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs
@@ -651,6 +651,23 @@ namespace MonoDevelop.VersionControl.Tests
Assert.AreEqual (VersionStatus.Versioned, Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache).Status);
}
+
+ [Test]
+ public virtual void MoveAndMoveBackCaseOnly ()
+ {
+ string srcFile = LocalPath.Combine ("testfile");
+ string dstFile = LocalPath.Combine ("TESTFILE");
+ AddFile ("testfile", "test", true, true);
+
+ Repo.MoveFile (srcFile, dstFile, true, new ProgressMonitor ());
+ Assert.AreEqual (VersionStatus.ScheduledAdd, Repo.GetVersionInfo (dstFile, VersionInfoQueryFlags.IgnoreCache).Status & VersionStatus.ScheduledAdd);
+ Assert.AreEqual (VersionStatus.ScheduledDelete, Repo.GetVersionInfo (srcFile, VersionInfoQueryFlags.IgnoreCache).Status & VersionStatus.ScheduledDelete);
+
+ Repo.MoveFile (dstFile, srcFile, true, new ProgressMonitor ());
+ Assert.AreEqual (VersionStatus.Unversioned, Repo.GetVersionInfo (dstFile, VersionInfoQueryFlags.IgnoreCache).Status);
+ Assert.AreEqual (VersionStatus.Versioned, Repo.GetVersionInfo (srcFile, VersionInfoQueryFlags.IgnoreCache).Status);
+
+ }
#region Util
protected void Checkout (string path, string url)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/GitIgnore.txt b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/GitIgnore.txt
index 7bbcfed0d4..4e82d2703b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/GitIgnore.txt
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/GitIgnore.txt
@@ -1,7 +1,7 @@
-#Autosave files
+# Autosave files
*~
-#build
+# build
[Oo]bj/
[Bb]in/
packages/
@@ -28,13 +28,13 @@ tarballs/
test-results/
Thumbs.db
-#Mac bundle stuff
+# Mac bundle stuff
*.dmg
*.app
-#resharper
+# resharper
*_Resharper.*
*.Resharper
-#dotCover
+# dotCover
*.dotCover
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 80fb850069..1d39fefa9c 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
@@ -120,7 +120,7 @@ namespace MonoDevelop.VersionControl.Git
comboSources.Sensitive = checkTrack.Active;
buttonOk.Sensitive = entryName.Text.Length > 0;
if (oldName != entryName.Text && repo.GetBranches ().Any (b => b.FriendlyName == entryName.Text)) {
- labelError.Markup = "<span color='red'>" + GettextCatalog.GetString ("A branch with this name already exists") + "</span>";
+ labelError.Markup = "<span color='" + Ide.Gui.Styles.ErrorForegroundColor.ToHexString (false) + "'>" + GettextCatalog.GetString ("A branch with this name already exists") + "</span>";
labelError.Show ();
buttonOk.Sensitive = false;
} else if (!Reference.IsValidName ("refs/" + entryName.Text)) {
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 01e1c89b1d..0d200c536e 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
@@ -658,14 +658,14 @@ namespace MonoDevelop.VersionControl.Git
// TODO: Remove me once https://github.com/libgit2/libgit2/pull/3137 goes in.
if (string.Equals (e.Message, "early EOF", StringComparison.OrdinalIgnoreCase))
message = GettextCatalog.GetString ("Unable to authorize credentials for the repository.");
+ else if (e.Message.StartsWith ("Invalid Content-Type", StringComparison.OrdinalIgnoreCase))
+ message = GettextCatalog.GetString ("Not a valid git repository.");
else if (string.Equals (e.Message, "Received unexpected content-type", StringComparison.OrdinalIgnoreCase))
message = GettextCatalog.GetString ("Not a valid git repository.");
else
message = e.Message;
- if (monitor != null)
- monitor.ReportError (message, null);
- retry = false;
+ throw new VersionControlException (message);
}
} while (retry);
}
@@ -1444,7 +1444,19 @@ namespace MonoDevelop.VersionControl.Git
dstRepo.Unstage (localDestPath);
if (srcRepo == dstRepo) {
- srcRepo.Move (localSrcPath, localDestPath);
+ if (string.Equals (localSrcPath, localDestPath, StringComparison.OrdinalIgnoreCase)) {
+ try {
+ string temp = Path.GetTempFileName ();
+ File.Delete (temp);
+ File.Move (localSrcPath, temp);
+ DeleteFile (localSrcPath, true, monitor, false);
+ File.Move (temp, localDestPath);
+ } finally {
+ srcRepo.Stage (localDestPath);
+ }
+ } else {
+ srcRepo.Move (localSrcPath, localDestPath);
+ }
ClearCachedVersionInfo (localSrcPath, localDestPath);
} else {
File.Copy (localSrcPath, localDestPath);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs
index 92322244d3..2e5c2499d3 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs
@@ -31,7 +31,7 @@ namespace MonoDevelop.VersionControl.Git
this.labelTop = new global::Gtk.Label ();
this.labelTop.Name = "labelTop";
this.labelTop.Xalign = 0F;
- this.labelTop.LabelProp = "A merge conflict has been detected in file <b>SomeFile.txt</b>";
+ this.labelTop.LabelProp = global::Mono.Unix.Catalog.GetString ("A merge conflict has been detected in file <b>SomeFile.txt</b>");
this.labelTop.UseMarkup = true;
this.vbox2.Add (this.labelTop);
global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.labelTop]));
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs
index a00846cbcf..af34ac1ab8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs
@@ -68,7 +68,7 @@ namespace MonoDevelop.VersionControl.Git
this.labelError = new global::Gtk.Label ();
this.labelError.Name = "labelError";
this.labelError.Xalign = 0F;
- this.labelError.LabelProp = "Error";
+ this.labelError.LabelProp = global::Mono.Unix.Catalog.GetString ("Error");
this.table4.Add (this.labelError);
global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table4 [this.labelError]));
w4.TopAttach = ((uint)(1));
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 68cebdc794..d6a085da80 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
@@ -346,7 +346,7 @@
<widget class="Gtk.Label" id="labelTop">
<property name="MemberName" />
<property name="Xalign">0</property>
- <property name="LabelProp">A merge conflict has been detected in file &lt;b&gt;SomeFile.txt&lt;/b&gt;</property>
+ <property name="LabelProp" translatable="yes">A merge conflict has been detected in file &lt;b&gt;SomeFile.txt&lt;/b&gt;</property>
<property name="UseMarkup">True</property>
</widget>
<packing>
@@ -936,7 +936,7 @@
<widget class="Gtk.Label" id="labelError">
<property name="MemberName" />
<property name="Xalign">0</property>
- <property name="LabelProp">Error</property>
+ <property name="LabelProp" translatable="yes">Error</property>
</widget>
<packing>
<property name="TopAttach">1</property>
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs
index d46fe7313a..d6bb6b400f 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs
@@ -113,6 +113,13 @@ namespace VersionControl.Subversion.Unix.Tests
base.UnlocksEntities ();
}
+ [Test]
+ [Ignore ("Subversion does not support case renaming on non-Windows")]
+ public override void MoveAndMoveBackCaseOnly ()
+ {
+ base.MoveAndMoveBackCaseOnly ();
+ }
+
protected override void PostUnlock ()
{
string added = LocalPath + "testfile";
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 45e98677d8..7f9cf78189 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
@@ -1128,7 +1128,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
return TextFile.ReadFile (sourcefile, data).Text;
// This outputs the contents of the base revision
// of a file to a stream.
- } catch (SubversionException e) {
+ } catch (SubversionException) {
// This occurs when we don't have a base file for
// the target file. We have no way of knowing if
// a file has a base version therefore this will do.
@@ -1253,11 +1253,11 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
static string BytesToSize (long kbytes)
{
if (kbytes < 1024)
- return String.Format ("{0} KBytes", kbytes);
+ return GettextCatalog.GetString ("{0} KBytes", kbytes);
// 16 * 1024
if (kbytes < 16384)
- return String.Format ("{0:0.0} MBytes", kbytes / 1024.0);
- return String.Format ("{0} MBytes", kbytes / 1024);
+ return GettextCatalog.GetString ("{0:0.0} MBytes", kbytes / 1024.0);
+ return GettextCatalog.GetString ("{0} MBytes", kbytes / 1024);
}
ProgressData progressData;
@@ -1540,7 +1540,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
try {
localpool = TryStartOperation (null);
CheckError (svn.client_upgrade (path, ctx, localpool));
- } catch (Exception e) {
+ } catch (Exception) {
tryParent = true;
} finally {
TryEndOperation (localpool);
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 b130d7937f..ba8b3d4d67 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
@@ -311,9 +311,14 @@ namespace MonoDevelop.VersionControl.Subversion
protected override void OnMoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
bool destIsVersioned = false;
-
- if (File.Exists (localDestPath))
+
+ if (File.Exists (localDestPath)) {
+ if (string.Equals (localSrcPath, localDestPath, StringComparison.OrdinalIgnoreCase)) {
+ Svn.Move (localSrcPath, localDestPath, true, monitor);
+ return;
+ }
throw new InvalidOperationException ("Cannot move file. Destination file already exist.");
+ }
if (IsVersioned (localDestPath)) {
// Revert to the original status
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 67bfa64504..b3b04540ee 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
@@ -113,7 +113,7 @@ namespace MonoDevelop.VersionControl.Subversion.Gui
this.labelReason = new global::Gtk.Label ();
this.labelReason.Name = "labelReason";
this.labelReason.Xalign = 0F;
- this.labelReason.LabelProp = "<b>Reason</b>";
+ this.labelReason.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Reason</b>");
this.labelReason.UseMarkup = true;
this.vbox3.Add (this.labelReason);
global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.labelReason]));
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 8d0ac6267e..de2159f78f 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
@@ -286,7 +286,7 @@
<widget class="Gtk.Label" id="labelReason">
<property name="MemberName" />
<property name="Xalign">0</property>
- <property name="LabelProp">&lt;b&gt;Reason&lt;/b&gt;</property>
+ <property name="LabelProp" translatable="yes">&lt;b&gt;Reason&lt;/b&gt;</property>
<property name="UseMarkup">True</property>
</widget>
<packing>
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 63c8b5dbcf..569406bad0 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
@@ -29,6 +29,7 @@ using System;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Fonts;
+using MonoDevelop.Core;
namespace MonoDevelop.VersionControl
{
@@ -71,10 +72,10 @@ namespace MonoDevelop.VersionControl
if (format == null)
return;
ChangeLogWriter writer = new ChangeLogWriter ("./", uinfo);
- string msg = "My changes made additional changes. This is sample documentation.";
- writer.AddFile (msg, "./somedir/myfile.ext");
- writer.AddFile (msg, "./yourfile.ext");
- writer.AddFile ("Some additional changes on another file of the project.", "./otherfile.ext");
+ string msg = GettextCatalog.GetString ("My changes made additional changes. This is sample documentation.");
+ writer.AddFile (msg, GettextCatalog.GetString ("./somedir/myfile.ext"));
+ writer.AddFile (msg, GettextCatalog.GetString ("./yourfile.ext"));
+ writer.AddFile (GettextCatalog.GetString ("Some additional changes on another file of the project."), GettextCatalog.GetString ("./otherfile.ext"));
format.MaxColumns = 60;
writer.MessageFormat = format;
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 e5644ec15e..963c7bb25f 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
@@ -281,8 +281,7 @@ namespace MonoDevelop.VersionControl.Dialogs
Gtk.Application.Invoke (delegate {
if (ex != null) {
- store.AppendValues (piter, null, "ERROR: " + ex.Message, "", true);
- LoggingService.LogError (ex.ToString ());
+ LoggingService.LogError ("Failed to load connected repositories.", ex.ToString ());
}
else {
foreach (Repository rep in repos)
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 ce3798cbda..a1e0e76859 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
@@ -602,7 +602,7 @@ namespace MonoDevelop.VersionControl.Views
foreach (Revision rev in history) {
if (rev == annotation.Revision) {
if (tooltip && annotation.HasEmail)
- return String.Format ("Email: {0}{1}{2}", annotation.Email, Environment.NewLine, rev.Message);
+ return GettextCatalog.GetString ("Email: {0}{1}{2}", annotation.Email, Environment.NewLine, rev.Message);
return rev.Message;
}
}
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
index 822dc26a77..158a59ef45 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CommonTextEditorOptions.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CommonTextEditorOptions.cs
@@ -160,14 +160,6 @@ namespace MonoDevelop.VersionControl.Views
}
}
- 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;
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 af0744795b..46f4d1d437 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
@@ -719,7 +719,7 @@ namespace MonoDevelop.VersionControl.Views
} else
currentRevisionShortened = false;
- labelRevision.Text = GettextCatalog.GetString ("revision: {0}", rev);
+ labelRevision.Text = GettextCatalog.GetString ("Revision: {0}", rev);
textviewDetails.Buffer.Text = d.Message;
if (select) {
@@ -789,7 +789,7 @@ namespace MonoDevelop.VersionControl.Views
{
if (currentRevisionShortened) {
Revision d = SelectedRevision;
- labelRevision.Text = GettextCatalog.GetString ("revision: {0}", d.Name);
+ labelRevision.Text = GettextCatalog.GetString ("Revision: {0}", d.Name);
currentRevisionShortened = false;
}
}
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 68592fd2b0..68bc41da23 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
@@ -1088,7 +1088,8 @@ namespace MonoDevelop.VersionControl.Views
Gtk.Application.Invoke (delegate { if (!disposed) FillDifs (); });
});
} else if (info.Exception != null) {
- text = new [] { GettextCatalog.GetString ("Could not get diff information. ") + info.Exception.Message };
+ text = new [] { GettextCatalog.GetString ("Could not get diff information. ") };
+ LoggingService.LogError ("Could not get diff information", info.Exception);
} else if (info.Diff.Value == null || string.IsNullOrEmpty (info.Diff.Value.Content)) {
text = new [] { GettextCatalog.GetString ("No differences found") };
} else {
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
index ab82ba054d..2024cb1548 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Styles.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Styles.cs
@@ -79,7 +79,7 @@ namespace MonoDevelop.VersionControl
public static void LoadStyles ()
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light) {
BlameView = new BlameViewStyle {
AnnotationMarkColor = Color.FromName ("#e5f1ff"),
AnnotationMarkModifiedColor = Color.FromName ("#ffff00"),
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj
index af01aa4c91..6623bff488 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj
@@ -981,6 +981,7 @@
<Compile Include="MonoDevelop.VersionControl.Views\CommonTextEditorOptions.cs" />
<Compile Include="MonoDevelop.VersionControl.Views\BaseView.cs" />
<Compile Include="MonoDevelop.VersionControl.Views\Styles.cs" />
+ <Compile Include="MonoDevelop.VersionControl\VersionControlInitializer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
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 b918d0707e..45cefe96fa 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs
@@ -3,7 +3,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MonoDevelop.Components;
-
+using MonoDevelop.Core;
+
namespace MonoDevelop.VersionControl
{
public partial class UrlBasedRepositoryEditor : Gtk.Bin, IRepositoryEditor
@@ -16,6 +17,10 @@ namespace MonoDevelop.VersionControl
public UrlBasedRepositoryEditor (UrlBasedRepository repo)
{
Build ();
+
+ labelError.Markup = "<small><span color='" + Ide.Gui.Styles.ErrorForegroundColor.ToHexString (false) + "'>"
+ + GettextCatalog.GetString ("Invalid URL") + "</span></small>";
+
protocols = new List<string> (repo.SupportedProtocols);
protocols.AddRange (repo.SupportedNonUrlProtocols);
@@ -54,11 +59,17 @@ namespace MonoDevelop.VersionControl
return false;
var tokens = url.Split (new [] { ':' }, 2);
+ if (tokens.Length < 2)
+ return false;
+
if (!Uri.IsWellFormedUriString (tokens [0], UriKind.RelativeOrAbsolute) ||
!Uri.IsWellFormedUriString (tokens [1], UriKind.RelativeOrAbsolute))
return false;
- var userAndHost = tokens [0].Split ('@');
+ var userAndHost = tokens [0].Split (new [] { '@' }, 2);
+ if (userAndHost.Length < 2)
+ return false;
+
repositoryUserEntry.Text = userAndHost [0];
repositoryServerEntry.Text = userAndHost [1];
repositoryPortSpin.Value = 22;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlInitializer.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlInitializer.cs
new file mode 100644
index 0000000000..974d2b3b1a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlInitializer.cs
@@ -0,0 +1,39 @@
+//
+// VersionControlInitializer.cs
+//
+// Author:
+// Marius Ungureanu <marius.ungureanu@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.Components.Commands;
+
+namespace MonoDevelop.VersionControl
+{
+ public class VersionControlInitializer : CommandHandler
+ {
+ protected override void Run ()
+ {
+ VersionControlService.Initialize ();
+ }
+ }
+}
+
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 e85f6206de..d64ab26073 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs
@@ -91,6 +91,11 @@ namespace MonoDevelop.VersionControl
};
AddinManager.AddExtensionNodeHandler ("/MonoDevelop/VersionControl/VersionControlSystems", OnExtensionChanged);
+ }
+
+ // This exists for the sole purpose of calling the static constructor.
+ public static void Initialize ()
+ {
}
static void OnExtensionChanged (object s, ExtensionNodeEventArgs args)
@@ -181,8 +186,9 @@ namespace MonoDevelop.VersionControl
switch (status & VersionStatus.LocalChangesMask) {
case VersionStatus.Modified:
+ return GettextCatalog.GetString ("Modified");
case VersionStatus.ScheduledReplace:
- return GettextCatalog.GetString ("Modified");
+ return GettextCatalog.GetString ("Renamed");
case VersionStatus.Conflicted:
return GettextCatalog.GetString ("Conflict");
case VersionStatus.ScheduledAdd:
@@ -610,7 +616,7 @@ namespace MonoDevelop.VersionControl
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;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs
index 1f0f56c7c5..295dee069d 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs
@@ -1,5 +1,6 @@
using System;
using System.Threading;
+using System.Threading.Tasks;
using Gtk;
using MonoDevelop.Core;
@@ -9,7 +10,6 @@ namespace MonoDevelop.VersionControl
internal abstract class VersionControlTask
{
ProgressMonitor tracker;
- ThreadNotify threadnotify;
protected VersionControlOperationType OperationType { get; set; }
@@ -27,7 +27,6 @@ namespace MonoDevelop.VersionControl
protected VersionControlTask()
{
OperationType = VersionControlOperationType.Other;
- threadnotify = new ThreadNotify(new ReadyEvent(Wakeup));
}
protected ProgressMonitor Monitor {
@@ -42,21 +41,25 @@ namespace MonoDevelop.VersionControl
public void Start() {
tracker = CreateProgressMonitor ();
tracker.BeginTask(GetDescription(), 1);
- ThreadPool.QueueUserWorkItem (BackgroundWorker);
+
+ // Sync invoke background worker which will end up doing async invoke on the internal run.
+ BackgroundWorker ();
}
- void BackgroundWorker (object state)
+ async void BackgroundWorker ()
{
try {
- Run();
+ await Task.Run (() => 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);
+ tracker.ReportError (msg + e.Message, null);
+ LoggingService.LogError ("Version Control command failed: ", e);
} catch (Exception e) {
string msg = GettextCatalog.GetString ("Version control operation failed: ");
tracker.ReportError (msg, e);
- } finally {
- threadnotify.WakeupMain();
+ LoggingService.LogError ("Version Control command failed: ", e);
+ } finally {
+ Wakeup ();
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml b/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
index 5606c64966..11f861310e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
@@ -321,6 +321,7 @@
<Extension path = "/MonoDevelop/Ide/StartupHandlers">
<Class class = "MonoDevelop.VersionControl.Views.SubviewAttachmentHandler"/>
+ <Class class = "MonoDevelop.VersionControl.VersionControlInitializer"/>
</Extension>
<Extension path = "/MonoDevelop/VersionControl/BlameView/ContextMenu">
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 8726b24f84..e4f7b47cff 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
@@ -157,7 +157,6 @@ namespace MonoDevelop.VersionControl
this.labelError = new global::Gtk.Label ();
this.labelError.Name = "labelError";
this.labelError.Xalign = 0F;
- this.labelError.LabelProp = global::Mono.Unix.Catalog.GetString ("<small><span color=\'red\'>Invalid URL</span></small>");
this.labelError.UseMarkup = true;
this.table1.Add (this.labelError);
global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1 [this.labelError]));
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 6f886546c3..d5a858599b 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
@@ -116,7 +116,7 @@ namespace MonoDevelop.VersionControl.Views
this.labelAuthor = new global::Gtk.Label ();
this.labelAuthor.Name = "labelAuthor";
this.labelAuthor.Xalign = 0F;
- this.labelAuthor.LabelProp = "Author";
+ this.labelAuthor.LabelProp = global::Mono.Unix.Catalog.GetString ("Author");
this.labelAuthor.Selectable = true;
this.hbox2.Add (this.labelAuthor);
global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.labelAuthor]));
@@ -127,7 +127,7 @@ namespace MonoDevelop.VersionControl.Views
this.labelRevision = new global::Gtk.Label ();
this.labelRevision.Name = "labelRevision";
this.labelRevision.Xalign = 1F;
- this.labelRevision.LabelProp = "Revision";
+ this.labelRevision.LabelProp = global::Mono.Unix.Catalog.GetString ("Revision");
this.labelRevision.Selectable = true;
this.hbox2.Add (this.labelRevision);
global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.labelRevision]));
@@ -141,7 +141,7 @@ namespace MonoDevelop.VersionControl.Views
this.labelDate = new global::Gtk.Label ();
this.labelDate.Name = "labelDate";
this.labelDate.Xalign = 0F;
- this.labelDate.LabelProp = "Date";
+ this.labelDate.LabelProp = global::Mono.Unix.Catalog.GetString ("Date");
this.labelDate.Selectable = true;
this.vbox5.Add (this.labelDate);
global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.labelDate]));
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/gui.stetic b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/gui.stetic
index 998958b1e3..53dcc5935a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/gui.stetic
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/gui.stetic
@@ -909,7 +909,6 @@
<property name="MemberName" />
<property name="Visible">False</property>
<property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">&lt;small&gt;&lt;span color='red'&gt;Invalid URL&lt;/span&gt;&lt;/small&gt;</property>
<property name="UseMarkup">True</property>
</widget>
<packing>
@@ -1687,7 +1686,7 @@
<widget class="Gtk.Label" id="labelAuthor">
<property name="MemberName" />
<property name="Xalign">0</property>
- <property name="LabelProp">Author</property>
+ <property name="LabelProp" translatable="yes">Author</property>
<property name="Selectable">True</property>
</widget>
<packing>
@@ -1701,7 +1700,7 @@
<widget class="Gtk.Label" id="labelRevision">
<property name="MemberName" />
<property name="Xalign">1</property>
- <property name="LabelProp">Revision</property>
+ <property name="LabelProp" translatable="yes">Revision</property>
<property name="Selectable">True</property>
<signal name="ButtonPressEvent" handler="OnLabelRevisionButtonPressEvent" />
</widget>
@@ -1722,7 +1721,7 @@
<widget class="Gtk.Label" id="labelDate">
<property name="MemberName" />
<property name="Xalign">0</property>
- <property name="LabelProp">Date</property>
+ <property name="LabelProp" translatable="yes">Date</property>
<property name="Selectable">True</property>
</widget>
<packing>
diff --git a/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs b/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
index 5633892e23..cd1fffbf39 100644
--- a/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
+++ b/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
@@ -692,8 +692,8 @@ namespace SubversionAddinWindows
static string BytesToSize (long kbytes)
{
if (kbytes < 1024)
- return String.Format ("{0} KBytes", kbytes);
- return String.Format ("{0:0.00} MBytes", kbytes / 1024.0);
+ return GettextCatalog.GetString ("{0} KBytes", kbytes);
+ return GettextCatalog.GetString ("{0:0.00} MBytes", kbytes / 1024.0);
}
static void ProgressWork (SvnProgressEventArgs e, ProgressData data, ProgressMonitor monitor)
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs
index 2a86ddfa95..b8e1afc933 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs
@@ -145,6 +145,9 @@ namespace WindowsPlatform.MainToolbar
model = value;
var dropMenu = DropMenu;
+ var open = dropMenu.IsSubmenuOpen;
+ if (open)
+ dropMenu.IsSubmenuOpen = false;
foreach (MenuItem item in dropMenu.Items)
item.Click -= OnMenuItemClicked;
@@ -157,6 +160,8 @@ namespace WindowsPlatform.MainToolbar
IsEnabled = Focusable = IsHitTestVisible = dropMenu.Items.Count > 1;
if (count == 0)
DropMenuText = "Default";
+
+ dropMenu.IsSubmenuOpen = open;
}
}
@@ -238,13 +243,20 @@ namespace WindowsPlatform.MainToolbar
set
{
model = value;
-
+
+ var open = DropMenu.IsSubmenuOpen;
+ if (open)
+ DropMenu.IsSubmenuOpen = false;
FillSource (DropMenu.Items, value);
+
+
int count = DropMenu.Items.Count;
IsEnabled = Focusable = IsHitTestVisible = count > 1;
if (count == 0)
DropMenuText = "Default";
+
+ DropMenu.IsSubmenuOpen = open;
}
}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs
index 37de00c61b..652b78d1fe 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs
@@ -74,6 +74,7 @@ namespace WindowsPlatform.MainToolbar
};
TaskService.Errors.TasksAdded += updateHandler;
TaskService.Errors.TasksRemoved += updateHandler;
+ BrandingService.ApplicationNameChanged += ApplicationNameChanged;
StatusText.ToolTipOpening += (o, e) => {
e.Handled = !TextTrimmed ();
@@ -119,6 +120,7 @@ namespace WindowsPlatform.MainToolbar
{
TaskService.Errors.TasksAdded -= updateHandler;
TaskService.Errors.TasksRemoved -= updateHandler;
+ BrandingService.ApplicationNameChanged -= ApplicationNameChanged;
}
public void EndProgress ()
@@ -223,7 +225,14 @@ namespace WindowsPlatform.MainToolbar
public void ShowReady ()
{
Status = StatusBarStatus.Ready;
- ShowMessage (BrandingService.StatusSteadyIconId, BrandingService.ApplicationName);
+ ShowMessage (BrandingService.StatusSteadyIconId, BrandingService.ApplicationLongName);
+ SetMessageSourcePad (null);
+ }
+
+ void ApplicationNameChanged (object sender, EventArgs e)
+ {
+ if (Status == StatusBarStatus.Ready)
+ ShowReady ();
}
public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf)
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFTitlebar.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFTitlebar.cs
new file mode 100644
index 0000000000..d075c0cdbc
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFTitlebar.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MonoDevelop.Components.Windows;
+
+namespace WindowsPlatform.MainToolbar
+{
+ public class WPFTitlebar : GtkWPFWidget
+ {
+ TitleBar titlebar;
+
+ public WPFTitlebar (TitleBar titlebar) : base (titlebar)
+ {
+ this.titlebar = titlebar;
+ HeightRequest = System.Windows.Forms.SystemInformation.CaptionHeight;
+ }
+
+ protected override void RepositionWpfWindow()
+ {
+ int scale = (int)MonoDevelop.Components.GtkWorkarounds.GetScaleFactor (this);
+
+ RepositionWpfWindow (scale, 1);
+ }
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs
index 5182f66273..186432a14e 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs
@@ -68,7 +68,7 @@ namespace WindowsPlatform.MainToolbar
};
toolbar.SearchBar.SearchBar.TextChanged += (o, e) => {
- if (string.IsNullOrEmpty (SearchText) || SearchText == SearchPlaceholderMessage)
+ if (SearchText == SearchPlaceholderMessage)
return;
if (SearchEntryChanged != null)
@@ -102,7 +102,13 @@ namespace WindowsPlatform.MainToolbar
};
}
- void SendKeyPress(KeyEventArgs ka)
+ protected override void RepositionWpfWindow()
+ {
+ int scale = (int)MonoDevelop.Components.GtkWorkarounds.GetScaleFactor(this);
+ RepositionWpfWindow (scale, scale);
+ }
+
+ void SendKeyPress(KeyEventArgs ka)
{
if (SearchEntryKeyPressed != null)
SearchEntryKeyPressed(this, ka);
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs
index 400adbb662..47abd820db 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs
@@ -271,7 +271,7 @@ namespace WindowsPlatform
public static void LoadStyles ()
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light) {
MainToolbarBackgroundBrush = new SolidColorBrush (ColorFromHex("FFFFFF", 0));
MainToolbarForegroundBrush = new SolidColorBrush (ColorFromHex("222222"));
MainToolbarDisabledForegroundBrush = new SolidColorBrush (ColorFromHex("808080"));
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Win32.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Win32.cs
index b6476ea979..a53d46a7f6 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/Win32.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Win32.cs
@@ -32,7 +32,19 @@ namespace CustomControls.OS
[DllImport (Win32.SHLWAPI, SetLastError = true, CharSet = CharSet.Unicode)]
public static extern int AssocQueryStringW (AssociationFlags flags, AssociationString str, string assoc, string extra, StringBuilder outBuffer, ref int outBufferSize);
- }
+
+ [DllImport (Win32.USER32)]
+ [return: MarshalAs (UnmanagedType.Bool)]
+ public static extern bool GetWindowPlacement (IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
+
+ [DllImport (Win32.USER32)]
+ [return: MarshalAs (UnmanagedType.Bool)]
+ public static extern bool SetWindowPlacement (IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
+
+ public const int SW_SHOWNORMAL = 1;
+ public const int SW_SHOWMINIMIZED = 2;
+ public const int SW_SHOWMAXIMIZED = 3;
+ }
[Flags]
public enum AssociationFlags {
@@ -75,4 +87,14 @@ namespace CustomControls.OS
SupportedUriProtocols,
MaxString
}
+
+ public struct WINDOWPLACEMENT
+ {
+ public int length;
+ public int flags;
+ public int showCmd;
+ public System.Drawing.Point ptMinPosition;
+ public System.Drawing.Point ptMaxPosition;
+ public System.Drawing.Rectangle rcNormalPosition;
+ }
}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
index ef14841f3f..96aabc224b 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
@@ -88,10 +88,9 @@ namespace MonoDevelop.Platform
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,
- };
+ titleBar = new TitleBar ();
+ var topMenu = new WPFTitlebar (titleBar);
+
//commandManager.IncompleteKeyPressed += (sender, e) => {
// if (e.Key == Gdk.Key.Alt_L) {
// Keyboard.Focus(titleBar.DockTitle.Children[0]);
@@ -134,6 +133,29 @@ namespace MonoDevelop.Platform
};
}
#endregion
+
+ public override bool GetIsFullscreen (Components.Window window)
+ {
+ WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();
+ lpwndpl.length = Marshal.SizeOf (lpwndpl);
+
+ Gtk.Window controlWindow = window;
+ IntPtr handle = GdkWin32.HgdiobjGet (controlWindow.GdkWindow);
+ Win32.GetWindowPlacement (handle, ref lpwndpl);
+ return lpwndpl.showCmd == Win32.SW_SHOWMAXIMIZED;
+ }
+
+ public override void SetIsFullscreen (Components.Window window, bool isFullscreen)
+ {
+ WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();
+ lpwndpl.length = Marshal.SizeOf (lpwndpl);
+
+ Gtk.Window controlWindow = window;
+ IntPtr handle = GdkWin32.HgdiobjGet (controlWindow.GdkWindow);
+ Win32.GetWindowPlacement (handle, ref lpwndpl);
+ lpwndpl.showCmd = isFullscreen ? Win32.SW_SHOWMAXIMIZED : Win32.SW_SHOWNORMAL;
+ Win32.SetWindowPlacement (handle, ref lpwndpl);
+ }
internal static Xwt.Toolkit WPFToolkit;
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
index 13557731e3..c4ab55eb00 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
@@ -119,6 +119,7 @@
<Compile Include="MainToolbar\Toolbar.xaml.cs">
<DependentUpon>ToolBar.xaml</DependentUpon>
</Compile>
+ <Compile Include="MainToolbar\WPFTitlebar.cs" />
<Compile Include="MainToolbar\WPFToolbar.cs" />
<Compile Include="Win32.cs" />
<Compile Include="WindowsPlatform.cs" />
diff --git a/main/src/addins/Xml/Completion/XmlCompletionData.cs b/main/src/addins/Xml/Completion/XmlCompletionData.cs
index 082283e33c..f84238579c 100644
--- a/main/src/addins/Xml/Completion/XmlCompletionData.cs
+++ b/main/src/addins/Xml/Completion/XmlCompletionData.cs
@@ -30,13 +30,10 @@ 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;
-using System.Threading.Tasks;
namespace MonoDevelop.Xml.Completion
{
@@ -110,13 +107,13 @@ namespace MonoDevelop.Xml.Completion
}
}
- public override async Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
if (XmlEditorOptions.AutoInsertFragments && dataType == DataType.XmlAttribute) {
//This temporary variable is needed because
//base.InsertCompletionText sets window.CompletionWidget to null
var completionWidget = window.CompletionWidget;
- ka = await base.InsertCompletionText (window, ka, descriptor);
+ base.InsertCompletionText (window, ref ka, descriptor);
if (completionWidget is ITextEditorImpl) {
((ITextEditorImpl)completionWidget).EditorExtension.Editor.StartSession (new SkipCharSession ('"'));
}
@@ -125,9 +122,8 @@ namespace MonoDevelop.Xml.Completion
//otherwise code calling InsertCompletionText will close completion window created by this command
Application.Invoke ((s,e) => IdeApp.CommandService.DispatchCommand (TextEditorCommands.ShowCompletionWindow));
ka &= ~KeyActions.CloseWindow;
- return ka;
} else {
- return await base.InsertCompletionText (window, ka, descriptor);
+ base.InsertCompletionText (window, ref ka, descriptor);
}
}
diff --git a/main/src/addins/Xml/Completion/XmlTagCompletionData.cs b/main/src/addins/Xml/Completion/XmlTagCompletionData.cs
index f45c9377b5..e0d08b5ef2 100644
--- a/main/src/addins/Xml/Completion/XmlTagCompletionData.cs
+++ b/main/src/addins/Xml/Completion/XmlTagCompletionData.cs
@@ -32,8 +32,7 @@ using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Core;
using MonoDevelop.Ide.Editor.Extension;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.Xml.Completion
{
@@ -68,7 +67,7 @@ namespace MonoDevelop.Xml.Completion
get { return element; }
}
- public override Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
var buf = window.CompletionWidget;
if (buf != null) {
@@ -79,8 +78,7 @@ namespace MonoDevelop.Xml.Completion
// Move caret into the middle of the tags
buf.CaretOffset = codeCompletionContext.TriggerOffset + cursorOffset;
- }
- return Task.FromResult (ka);
+ }
}
}
}
diff --git a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
index 36dcab9dc4..e135de5e60 100644
--- a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
+++ b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
@@ -234,11 +234,11 @@ namespace MonoDevelop.Xml.Editor
{
}
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
if (Editor.Options.IndentStyle == IndentStyle.Smart) {
var newLine = Editor.CaretLine + 1;
- var ret = await base.KeyPress (descriptor);
+ var ret = base.KeyPress (descriptor);
if (descriptor.SpecialKey == SpecialKey.Return && Editor.CaretLine == newLine) {
string indent = GetLineIndent (newLine);
var oldIndent = Editor.GetLineIndent (newLine);
@@ -251,7 +251,7 @@ namespace MonoDevelop.Xml.Editor
}
return ret;
}
- return await base.KeyPress (descriptor);
+ return base.KeyPress (descriptor);
}
#region Code completion
diff --git a/main/src/addins/Xml/Editor/XmlEditorService.cs b/main/src/addins/Xml/Editor/XmlEditorService.cs
index 4b388eb528..d0dd8584c1 100644
--- a/main/src/addins/Xml/Editor/XmlEditorService.cs
+++ b/main/src/addins/Xml/Editor/XmlEditorService.cs
@@ -33,11 +33,7 @@ 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;
diff --git a/main/src/addins/Xml/Editor/XmlTextEditorExtension.cs b/main/src/addins/Xml/Editor/XmlTextEditorExtension.cs
index cc7b6447df..6551965815 100644
--- a/main/src/addins/Xml/Editor/XmlTextEditorExtension.cs
+++ b/main/src/addins/Xml/Editor/XmlTextEditorExtension.cs
@@ -38,7 +38,6 @@ 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;
@@ -611,16 +610,17 @@ namespace MonoDevelop.Xml.Editor
#region Smart indent
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
bool result;
+
if (Editor.Options.IndentStyle == IndentStyle.Smart && descriptor.SpecialKey == SpecialKey.Return) {
- result = await base.KeyPress (descriptor);
+ result = base.KeyPress (descriptor);
SmartIndentLine (Editor.CaretLine);
return result;
}
- return await base.KeyPress (descriptor);
+ return base.KeyPress (descriptor);
}
void SmartIndentLine (int line)
@@ -711,7 +711,7 @@ namespace MonoDevelop.Xml.Editor
} catch (Exception ex) {
LoggingService.LogError ("Could not open document.", ex);
- MessageService.ShowException (ex, "Could not open document.");
+ MessageService.ShowError ("Could not open document.", ex);
}
}
}
@@ -747,7 +747,7 @@ namespace MonoDevelop.Xml.Editor
}
} catch (Exception ex) {
MonoDevelop.Core.LoggingService.LogError ("Could not open document.", ex);
- MessageService.ShowException (ex, "Could not open document.");
+ MessageService.ShowError ("Could not open document.", ex);
}
}
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 fc3c93dfab..13d37ef823 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
@@ -1060,6 +1060,7 @@ namespace Mono.TextEditor
readonly object syncObject = new object();
CancellationTokenSource foldSegmentSrc;
+ object foldSegmentTaskLock = new object ();
Task foldSegmentTask;
public void UpdateFoldSegments (List<FoldSegment> newSegments, bool startTask = false, bool useApplicationInvoke = false, CancellationToken masterToken = default(CancellationToken))
@@ -1067,38 +1068,39 @@ namespace Mono.TextEditor
if (newSegments == null) {
return;
}
-
- InterruptFoldWorker ();
- bool update;
- if (!startTask) {
- var newFoldedSegments = UpdateFoldSegmentWorker (newSegments, out update);
- if (useApplicationInvoke) {
- Gtk.Application.Invoke (delegate {
+ lock (foldSegmentTaskLock) {
+ InterruptFoldWorker ();
+ bool update;
+ if (!startTask) {
+ var newFoldedSegments = UpdateFoldSegmentWorker (newSegments, out update);
+ if (useApplicationInvoke) {
+ Gtk.Application.Invoke (delegate {
+ foldedSegments = newFoldedSegments;
+ InformFoldTreeUpdated ();
+ });
+ } else {
foldedSegments = newFoldedSegments;
InformFoldTreeUpdated ();
- });
- } else {
- foldedSegments = newFoldedSegments;
- InformFoldTreeUpdated ();
- }
- return;
- }
- foldSegmentSrc = new CancellationTokenSource ();
- masterToken.Register (InterruptFoldWorker);
- var token = foldSegmentSrc.Token;
- foldSegmentTask = Task.Factory.StartNew (delegate {
- var segments = UpdateFoldSegmentWorker (newSegments, out update, token);
- if (token.IsCancellationRequested)
+ }
return;
- Gtk.Application.Invoke (delegate {
+ }
+ foldSegmentSrc = new CancellationTokenSource ();
+ masterToken.Register (InterruptFoldWorker);
+ var token = foldSegmentSrc.Token;
+ foldSegmentTask = Task.Factory.StartNew (delegate {
+ var segments = UpdateFoldSegmentWorker (newSegments, out update, token);
if (token.IsCancellationRequested)
return;
foldedSegments = segments;
- InformFoldTreeUpdated ();
- if (update)
- CommitUpdateAll ();
- });
- }, token);
+ Gtk.Application.Invoke (delegate {
+ if (token.IsCancellationRequested)
+ return;
+ InformFoldTreeUpdated ();
+ if (update)
+ CommitUpdateAll ();
+ });
+ }, token);
+ }
}
void RemoveFolding (FoldSegment folding)
@@ -1180,7 +1182,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;
}
}
@@ -1269,28 +1277,16 @@ namespace Mono.TextEditor
public void EnsureOffsetIsUnfolded (int offset)
{
- bool needUpdate = false;
foreach (FoldSegment fold in GetFoldingsFromOffset (offset).Where (f => f.IsFolded && f.Offset < offset && offset < f.EndOffset)) {
- needUpdate = true;
fold.IsFolded = false;
}
- if (needUpdate) {
- RequestUpdate (new UpdateAll ());
- 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 ()
@@ -1302,13 +1298,30 @@ namespace Mono.TextEditor
public event EventHandler FoldTreeUpdated;
HashSet<FoldSegment> foldedSegments = new HashSet<FoldSegment> ();
+
public IEnumerable<FoldSegment> FoldedSegments {
get {
return foldedSegments;
}
}
+
internal void InformFoldChanged (FoldSegmentEventArgs args)
{
+ lock (foldSegmentTaskLock) {
+ if (foldSegmentTask != null) {
+ foldSegmentTask.ContinueWith (delegate {
+ Gtk.Application.Invoke (delegate {
+ InternalInformFoldChanged (args);
+ });
+ });
+ } else {
+ InternalInformFoldChanged (args);
+ }
+ }
+ }
+
+ void InternalInformFoldChanged (FoldSegmentEventArgs args)
+ {
if (args.FoldSegment.IsFolded) {
foldedSegments.Add (args.FoldSegment);
} else {
@@ -1318,7 +1331,7 @@ namespace Mono.TextEditor
if (handler != null)
handler (this, args);
}
-
+
public event EventHandler<FoldSegmentEventArgs> Folded;
#endregion
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 c9cfe5fc9d..828daf8b7e 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
@@ -1200,8 +1200,9 @@ namespace Mono.TextEditor
public static double GetScaleFactor ()
{
return GetScaleFactor (Gdk.Screen.Default, 0);
- }
-
+ }
+
+ /*
public static double GetPixelScale ()
{
if (Platform.IsWindows)
@@ -1216,8 +1217,9 @@ namespace Mono.TextEditor
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)
+ */
+
+ 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);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs
index 68d3b04152..381d056ea7 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs
@@ -36,8 +36,7 @@ using Mono.TextEditor.Theatrics;
using Gdk;
using Gtk;
-using System.Threading.Tasks;
-
+
namespace Mono.TextEditor
{
[System.ComponentModel.Category("Mono.TextEditor")]
@@ -877,10 +876,10 @@ namespace Mono.TextEditor
/// <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 Task<bool> OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.ModifierType state)
+ protected internal virtual bool OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.ModifierType state)
{
SimulateKeyPress (key, ch, state);
- return Task.FromResult (true);
+ return true;
}
public void SimulateKeyPress (Gdk.Key key, uint unicodeChar, ModifierType modifier)
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 ef32ab7282..269cfad5d3 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
@@ -299,8 +299,6 @@ namespace Mono.TextEditor
// This is required to properly handle resizing and rendering of children
ResizeMode = ResizeMode.Queue;
snooperID = Gtk.Key.SnooperInstall (TooltipKeySnooper);
-
- KeyPressEvent += OnKeyPress;
}
uint snooperID;
@@ -599,7 +597,7 @@ namespace Mono.TextEditor
}
}
- async void IMCommit (object sender, Gtk.CommitArgs ca)
+ void IMCommit (object sender, Gtk.CommitArgs ca)
{
if (!IsRealized || !IsFocus)
return;
@@ -616,9 +614,9 @@ namespace Mono.TextEditor
//include the other pre-IM state *if* the post-IM char matches the pre-IM (key-mapped) one
if (lastIMEventMappedChar == utf32Char && lastIMEventMappedChar == (uint)lastIMEventMappedKey) {
- await editor.OnIMProcessedKeyPressEvent (lastIMEventMappedKey, lastIMEventMappedChar, lastIMEventMappedModifier);
+ editor.OnIMProcessedKeyPressEvent (lastIMEventMappedKey, lastIMEventMappedChar, lastIMEventMappedModifier);
} else {
- await editor.OnIMProcessedKeyPressEvent ((Gdk.Key)0, (uint)utf32Char, Gdk.ModifierType.None);
+ editor.OnIMProcessedKeyPressEvent ((Gdk.Key)0, (uint)utf32Char, Gdk.ModifierType.None);
}
}
@@ -1017,53 +1015,52 @@ namespace Mono.TextEditor
GdkWindow.Cursor = currentCursor = cursor;
}
- async void OnKeyPress (object sender, Gtk.KeyPressEventArgs args)
+ protected override bool OnKeyPressEvent (Gdk.EventKey evt)
{
- Gdk.EventKey evt = args.Event;
- args.RetVal = true;
-
Gdk.Key key;
Gdk.ModifierType mod;
- KeyboardShortcut [] accels;
- GtkWorkarounds.MapKeys (evt, out key, out mod, out accels);
- //HACK: we never call base.OnKeyPressEvent, so implement the popup key manually
+ KeyboardShortcut[] accels;
+ GtkWorkarounds.MapKeys (evt, out key, out mod, out accels);
+ //HACK: we never call base.OnKeyPressEvent, so implement the popup key manually
if (key == Gdk.Key.Menu || (key == Gdk.Key.F10 && mod.HasFlag (ModifierType.ShiftMask))) {
OnPopupMenu ();
- return;
+ return true;
}
uint keyVal = (uint)key;
CurrentMode.SelectValidShortcut (accels, out key, out mod);
if (key == Gdk.Key.F1 && (mod & (ModifierType.ControlMask | ModifierType.ShiftMask)) == ModifierType.ControlMask) {
var p = LocationToPoint (Caret.Location);
ShowTooltip (Gdk.ModifierType.None, Caret.Offset, p.X, p.Y);
- return;
+ return true;
}
if (key == Gdk.Key.F2 && textViewMargin.IsCodeSegmentPreviewWindowShown) {
textViewMargin.OpenCodeSegmentEditor ();
- return;
- }
-
- //FIXME: why are we doing this?
+ return true;
+ }
+
+ //FIXME: why are we doing this?
if ((key == Gdk.Key.space || key == Gdk.Key.parenleft || key == Gdk.Key.parenright) && (mod & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask)
- mod = Gdk.ModifierType.None;
-
- uint unicodeChar = Gdk.Keyval.ToUnicode (keyVal);
-
+ mod = Gdk.ModifierType.None;
+
+ uint unicodeChar = Gdk.Keyval.ToUnicode (keyVal);
+
if (CurrentMode.WantsToPreemptIM || CurrentMode.PreemptIM (key, unicodeChar, mod)) {
- ResetIMContext ();
- //FIXME: should call base.OnKeyPressEvent when SimulateKeyPress didn't handle the event
+ ResetIMContext ();
+ //FIXME: should call base.OnKeyPressEvent when SimulateKeyPress didn't handle the event
SimulateKeyPress (key, unicodeChar, mod);
- return;
+ return true;
}
bool filter = IMFilterKeyPress (evt, key, unicodeChar, mod);
if (filter)
- return;
-
- //FIXME: OnIMProcessedKeyPressEvent should return false when it didn't handle the event
- if (await editor.OnIMProcessedKeyPressEvent (key, unicodeChar, mod))
- return;
- args.RetVal = base.OnKeyPressEvent (evt);
+ return true;
+
+ //FIXME: OnIMProcessedKeyPressEvent should return false when it didn't handle the event
+ if (editor.OnIMProcessedKeyPressEvent (key, unicodeChar, mod))
+ return true;
+
+ return base.OnKeyPressEvent (evt);
}
+
protected override bool OnKeyReleaseEvent (EventKey evnt)
{
diff --git a/main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml b/main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml
index 874e07e1f2..24bf17ca41 100644
--- a/main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml
+++ b/main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml
@@ -295,36 +295,38 @@
<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">
+ <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 -->
+ <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+``[^`]*``)(?:\s[^=:])" ignorecase="False">
+ <!-- let inline ``some id`` 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="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 mutable x = 1 -->
+ <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 Field Declaration"/>
- <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+``[^`]*``)(?:\s+[^=:])" ignorecase="False">
+ <!-- let inline ``some id`` x y = x + y -->
+ <Group color="Keyword(Iteration)"/>
+ <Group color="Keyword(Modifiers)"/>
+ <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)"/>
@@ -373,7 +375,7 @@
<Group color="Plain Text"/>
</Match>
- <Match expression="(module|type)(\s+)(\w+|``[^`]*``)" ignorecase="False">
+ <Match expression="(module|type|and)(\s+)(\w+|``[^`]*``)" ignorecase="False">
<Group color="Keyword(Namespace)"/>
<Group color="Plain Text"/>
<Group color="User Types"/>
@@ -426,4 +428,10 @@
<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/MonoDevelop.Core.Assemblies/TargetFramework.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs
index 0482e38480..ab96b7ac7a 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs
@@ -378,10 +378,10 @@ namespace MonoDevelop.Core.Assemblies
ainfo.Update (an);
assemblies.Add (ainfo);
} catch (BadImageFormatException ex) {
- LoggingService.LogError ("Invalid assembly in framework '{0}': {1}", fx.Id, f);
+ LoggingService.LogError ("Invalid assembly in framework '{0}': {1}{2}{3}", fx.Id, f, Environment.NewLine, ex.ToString ());
} catch (Exception ex) {
- LoggingService.LogError ("Error reading 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.Execution/ProcessWrapper.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs
index 296f6d18e8..a033628f9a 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs
@@ -96,8 +96,12 @@ namespace MonoDevelop.Core.Execution
if (endEventErr != null)
endEventErr.WaitOne ();
- if (HasExited)
- operation.ExitCode = ExitCode;
+ try {
+ if (HasExited)
+ operation.ExitCode = ExitCode;
+ } catch {
+ // Ignore
+ }
try {
OnExited (this, EventArgs.Empty);
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 ef02105107..78dc2bca5b 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/InstrumentationService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/InstrumentationService.cs
@@ -398,7 +398,7 @@ namespace MonoDevelop.Core.Instrumentation
{
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;
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 57f9fd7e47..cef5943162 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
@@ -46,13 +46,13 @@ 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: ProgressMonitor
{
- ProgressMonitor masterMonitor;
+ ProgressMonitor leaderMonitor;
List<MonitorInfo> monitors = new List<MonitorInfo> ();
class MonitorInfo {
@@ -61,8 +61,8 @@ namespace MonoDevelop.Core.ProgressMonitoring
public CancellationTokenRegistration CancellationTokenRegistration;
}
- public ProgressMonitor MasterMonitor {
- get { return this.masterMonitor; }
+ public ProgressMonitor LeaderMonitor {
+ get { return this.leaderMonitor; }
}
@@ -70,32 +70,32 @@ namespace MonoDevelop.Core.ProgressMonitoring
{
}
- public AggregatedProgressMonitor (ProgressMonitor masterMonitor, params ProgressMonitor[] slaveMonitors): this (masterMonitor, null, slaveMonitors)
+ public AggregatedProgressMonitor (ProgressMonitor leaderMonitor, params ProgressMonitor[] followerMonitors): this (leaderMonitor, null, followerMonitors)
{
}
- internal AggregatedProgressMonitor (ProgressMonitor masterMonitor, CancellationTokenSource cancelSource, params ProgressMonitor[] slaveMonitors)
+ internal AggregatedProgressMonitor (ProgressMonitor leaderMonitor, CancellationTokenSource cancelSource, params ProgressMonitor[] followerMonitors)
{
CancellationTokenSource = cancelSource ?? new CancellationTokenSource ();
- this.masterMonitor = masterMonitor;
- AddSlaveMonitor (masterMonitor, MonitorAction.All);
- foreach (ProgressMonitor mon in slaveMonitors)
- AddSlaveMonitor (mon);
+ this.leaderMonitor = leaderMonitor;
+ AddFollowerMonitor (leaderMonitor, MonitorAction.All);
+ foreach (ProgressMonitor mon in followerMonitors)
+ AddFollowerMonitor (mon);
}
- public new void AddSlaveMonitor (ProgressMonitor slaveMonitor)
+ public new void AddFollowerMonitor (ProgressMonitor followerMonitor)
{
- AddSlaveMonitor (slaveMonitor, MonitorAction.All);
+ AddFollowerMonitor (followerMonitor, MonitorAction.All);
}
- public void AddSlaveMonitor (ProgressMonitor 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)
- smon.CancellationTokenRegistration = slaveMonitor.CancellationToken.Register (OnSlaveCancelRequested);
+ if ((actionMask & MonitorAction.FollowerCancel) != 0)
+ smon.CancellationTokenRegistration = followerMonitor.CancellationToken.Register (OnFollowerCancelRequested);
}
protected override void OnBeginTask (string name, int totalWork, int stepWork)
@@ -138,7 +138,7 @@ namespace MonoDevelop.Core.ProgressMonitoring
if ((info.ActionMask & MonitorAction.Tasks) != 0) {
var sm = info.Monitor.BeginAsyncStep (message, work);
sm.ReportGlobalDataToParent = false;
- am.AddSlaveMonitor (sm);
+ am.AddFollowerMonitor (sm);
}
}
@@ -183,12 +183,12 @@ namespace MonoDevelop.Core.ProgressMonitoring
foreach (MonitorInfo info in monitors) {
if ((info.ActionMask & MonitorAction.Dispose) != 0)
info.Monitor.Dispose ();
- if ((info.ActionMask & MonitorAction.SlaveCancel) != 0)
+ if ((info.ActionMask & MonitorAction.FollowerCancel) != 0)
info.CancellationTokenRegistration.Dispose ();
}
}
- void OnSlaveCancelRequested ()
+ void OnFollowerCancelRequested ()
{
CancellationTokenSource.Cancel ();
}
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 22e3dce120..2251f9698f 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProjectLoadProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProjectLoadProgressMonitor.cs
@@ -31,7 +31,7 @@ namespace MonoDevelop.Core.ProgressMonitoring
{
public ConsoleProjectLoadProgressMonitor (ConsoleProgressMonitor monitor)
{
- AddSlaveMonitor (monitor);
+ AddFollowerMonitor (monitor);
}
public override MonoDevelop.Projects.Extensions.MigrationType ShouldMigrateProject ()
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 57fae2a68f..3d1a800824 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs
@@ -35,13 +35,13 @@ namespace MonoDevelop.Core.ProgressMonitoring
public class FilteredProgressMonitor: AggregatedProgressMonitor
{
public FilteredProgressMonitor (ProgressMonitor targetMonitor)
- : this (targetMonitor, MonitorAction.WriteLog | MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.ReportSuccess | MonitorAction.Cancel | MonitorAction.SlaveCancel)
+ : this (targetMonitor, MonitorAction.WriteLog | MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.ReportSuccess | MonitorAction.Cancel | MonitorAction.FollowerCancel)
{
}
public FilteredProgressMonitor (ProgressMonitor targetMonitor, MonitorAction actionMask)
{
- AddSlaveMonitor (targetMonitor, actionMask);
+ AddFollowerMonitor (targetMonitor, actionMask);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
index 3631614976..00d711ef7e 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
@@ -561,6 +561,7 @@
<Compile Include="MonoDevelop.Core.Execution\BinaryMessage.cs" />
<Compile Include="MonoDevelop.Core.Execution\RemoteProcessConnection.cs" />
<Compile Include="MonoDevelop.Core.Execution\RemoteProcessServer.cs" />
+ <Compile Include="MonoDevelop.Projects\AssemblyReference.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs
index 2eccacfa18..b5d5675c9f 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs
@@ -42,12 +42,44 @@ namespace MonoDevelop.Core
static XDocument brandingDocument;
static XDocument localizedBrandingDocument;
- public static 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 {
@@ -77,6 +109,7 @@ namespace MonoDevelop.Core
}
}
ApplicationName = GetString ("ApplicationName");
+ ApplicationLongName = GetString ("ApplicationLongName") ?? ApplicationName;
SuiteName = GetString ("SuiteName");
ProfileDirectoryName = GetString ("ProfileDirectoryName");
StatusSteadyIconId = GetString ("StatusAreaSteadyIcon");
@@ -84,9 +117,6 @@ namespace MonoDevelop.Core
} catch (Exception ex) {
LoggingService.LogError ("Could not read branding document", ex);
}
-
- if (string.IsNullOrEmpty (ApplicationName))
- ApplicationName = "MonoDevelop";
if (string.IsNullOrEmpty (SuiteName))
SuiteName = ApplicationName;
@@ -187,18 +217,11 @@ namespace MonoDevelop.Core
public static event EventHandler ApplicationNameChanged;
- public static void UpdateApplicationName (string name)
+ static void OnApplicationNameChanged ()
{
- if (string.IsNullOrEmpty (name))
- name = "MonoDevelop";
-
- if (ApplicationName != name) {
- ApplicationName = name;
-
- var handler = ApplicationNameChanged;
- if (handler != null)
- handler (null, new EventArgs ());
- }
+ 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/Gettext.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Gettext.cs
index c022562ca3..6fe0fe6e4a 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 = Runtime.Preferences.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("_", "-");
@@ -153,7 +153,7 @@ namespace MonoDevelop.Core
return Catalog.GetPluralString (singular, plural, number);
} catch (Exception e) {
LoggingService.LogError ("Failed to localize string", e);
- return number == 0 ? singular : plural;
+ return number == 1 ? singular : plural;
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs
index 94b8fae978..6aea01f2ce 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs
@@ -65,7 +65,7 @@ namespace MonoDevelop.Core
List<string> warnings = new List<string> ();
List<string> messages = new List<string> ();
- List<ProgressMonitor> slaveMonitors;
+ List<ProgressMonitor> followerMonitors;
List<Action> disposeCallbacks;
object localLock = new object ();
@@ -143,8 +143,8 @@ namespace MonoDevelop.Core
else
OnCompleted ();
- if (slaveMonitors != null) {
- foreach (var m in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
m.Dispose ();
}
if (disposeCallbacks != null) {
@@ -154,20 +154,20 @@ namespace MonoDevelop.Core
}
}
- protected void AddSlaveMonitor (ProgressMonitor monitor)
+ protected void AddFollowerMonitor (ProgressMonitor monitor)
{
- if (slaveMonitors == null)
- slaveMonitors = new List<ProgressMonitor> ();
- slaveMonitors.Add (monitor);
+ if (followerMonitors == null)
+ followerMonitors = new List<ProgressMonitor> ();
+ followerMonitors.Add (monitor);
logWriter.ChainWriter (monitor.Log);
errorLogWriter.ChainWriter (monitor.ErrorLog);
}
- protected void RemoveSlaveMonitor (ProgressMonitor monitor)
+ protected void RemoveFollowerMonitor (ProgressMonitor monitor)
{
- if (slaveMonitors == null)
+ if (followerMonitors == null)
return;
- slaveMonitors.Remove (monitor);
+ followerMonitors.Remove (monitor);
logWriter.UnchainWriter (monitor.Log);
errorLogWriter.UnchainWriter (monitor.ErrorLog);
}
@@ -219,8 +219,8 @@ namespace MonoDevelop.Core
ReportProgressChanged ();
- if (slaveMonitors != null) {
- foreach (var m in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
m.BeginTask (name, totalWork);
}
return t;
@@ -251,8 +251,8 @@ namespace MonoDevelop.Core
ReportProgressChanged ();
- if (slaveMonitors != null) {
- foreach (var m in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
m.EndTask ();
}
}
@@ -291,8 +291,8 @@ namespace MonoDevelop.Core
ReportProgressChanged ();
}
- if (slaveMonitors != null) {
- foreach (var m in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
m.Step (message, work);
}
}
@@ -325,8 +325,8 @@ namespace MonoDevelop.Core
ReportProgressChanged ();
}
- if (slaveMonitors != null) {
- foreach (var m in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
m.BeginStep (message, work);
}
}
@@ -335,8 +335,8 @@ namespace MonoDevelop.Core
{
ConsumePendingWork ();
- if (slaveMonitors != null) {
- foreach (var m in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
m.EndStep ();
}
}
@@ -383,9 +383,9 @@ namespace MonoDevelop.Core
ReportProgressChanged ();
}
- if (slaveMonitors != null) {
- foreach (var sm in slaveMonitors)
- m.AddSlaveMonitor (sm.BeginAsyncStep (message, work));
+ if (followerMonitors != null) {
+ foreach (var sm in followerMonitors)
+ m.AddFollowerMonitor (sm.BeginAsyncStep (message, work));
}
return m;
}
@@ -402,8 +402,8 @@ namespace MonoDevelop.Core
else
OnWarningReported (message);
- if (slaveMonitors != null) {
- foreach (var sm in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var sm in followerMonitors)
sm.ReportWarning (message);
}
}
@@ -420,8 +420,8 @@ namespace MonoDevelop.Core
else
OnSuccessReported (message);
- if (slaveMonitors != null) {
- foreach (var sm in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var sm in followerMonitors)
sm.ReportSuccess (message);
}
}
@@ -445,8 +445,8 @@ namespace MonoDevelop.Core
else
OnErrorReported (msg, exception);
- if (slaveMonitors != null) {
- foreach (var sm in slaveMonitors)
+ if (followerMonitors != null) {
+ foreach (var sm in followerMonitors)
sm.ReportError (message, exception);
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs
index 9b805ebeb5..5bd8f88fe8 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs
@@ -44,6 +44,7 @@ namespace MonoDevelop.Projects.MSBuild
class LoadedProjectInfo
{
public MSBuildProject Project;
+ public DateTime LastWriteTime;
public int ReferenceCount;
}
@@ -92,11 +93,16 @@ namespace MonoDevelop.Projects.MSBuild
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 };
+ loadedProjects [fileName] = new LoadedProjectInfo { Project = p, LastWriteTime = File.GetLastWriteTime (fileName) };
//Console.WriteLine ("Loaded: " + fileName);
return p;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs
index 909fb2a6d6..95dc677318 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs
@@ -486,7 +486,7 @@ namespace MonoDevelop.Projects.MSBuild
var aggregatedMonitor = monitor as AggregatedProgressMonitor;
if (aggregatedMonitor != null)
- return aggregatedMonitor.MasterMonitor as ProjectLoadProgressMonitor;
+ return aggregatedMonitor.LeaderMonitor as ProjectLoadProgressMonitor;
return null;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs
index a4ebb44cdb..871aed962b 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs
@@ -97,7 +97,7 @@ namespace MonoDevelop.Projects.MSBuild
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)
+ if (path != null && 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;
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs
index e16eedf6b4..4870f1cba1 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs
@@ -182,7 +182,7 @@ namespace MonoDevelop.Projects.MSBuild
{
RemoteBuildEngine engine;
IProjectBuilder builder;
- Dictionary<string,string[]> referenceCache;
+ Dictionary<string,AssemblyReference[]> referenceCache;
AsyncCriticalSection referenceCacheLock = new AsyncCriticalSection ();
string file;
static int lastTaskId;
@@ -192,7 +192,7 @@ namespace MonoDevelop.Projects.MSBuild
this.file = file;
this.engine = engine;
builder = engine.LoadProject (file);
- referenceCache = new Dictionary<string, string[]> ();
+ referenceCache = new Dictionary<string, AssemblyReference[]> ();
}
public event EventHandler Disconnected;
@@ -263,9 +263,9 @@ namespace MonoDevelop.Projects.MSBuild
return t;
}
- public async Task<string[]> ResolveAssemblyReferences (ProjectConfigurationInfo[] configurations, CancellationToken cancellationToken)
+ public async Task<AssemblyReference[]> ResolveAssemblyReferences (ProjectConfigurationInfo[] configurations, CancellationToken cancellationToken)
{
- string[] refs = null;
+ AssemblyReference[] refs = null;
var id = configurations [0].Configuration + "|" + configurations [0].Platform;
using (await referenceCacheLock.EnterAsync ()) {
@@ -300,16 +300,17 @@ namespace MonoDevelop.Projects.MSBuild
} catch (Exception ex) {
CheckDisconnected ();
LoggingService.LogError ("ResolveAssemblyReferences failed", ex);
- return new string [0];
+ return new AssemblyReference [0];
} finally {
EndOperation ();
}
List<MSBuildEvaluatedItem> items;
if (result.Items.TryGetValue ("ReferencePath", out items) && items != null) {
- refs = items.Select (i => i.ItemSpec).ToArray ();
+ string aliases;
+ refs = items.Select (i => new AssemblyReference (i.ItemSpec, i.Metadata.TryGetValue ("Aliases", out aliases) ? aliases : "")).ToArray ();
} else
- refs = new string[0];
+ refs = new AssemblyReference [0];
referenceCache [id] = refs;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AssemblyReference.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AssemblyReference.cs
new file mode 100644
index 0000000000..78c5ebbd4f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AssemblyReference.cs
@@ -0,0 +1,65 @@
+//
+// AssemblyReference.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;
+using System.Linq;
+
+namespace MonoDevelop.Projects
+{
+ public sealed class AssemblyReference
+ {
+ public AssemblyReference (FilePath path, string aliases = null)
+ {
+ FilePath = path;
+ Aliases = aliases ?? "";
+ }
+
+ public FilePath FilePath { get; private set; }
+ public string Aliases { get; private set; }
+
+ public override bool Equals (object obj)
+ {
+ var ar = obj as AssemblyReference;
+ return ar != null && ar.FilePath == FilePath && ar.Aliases == Aliases;
+ }
+
+ public override int GetHashCode ()
+ {
+ unchecked {
+ return FilePath.GetHashCode () ^ Aliases.GetHashCode ();
+ }
+ }
+
+ /// <summary>
+ /// Returns an enumerable collection of aliases.
+ /// </summary>
+ public IEnumerable<string> EnumerateAliases ()
+ {
+ return Aliases.Split (',', ';').Where (a => !string.IsNullOrEmpty (a));
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs
index d6afe1b4f3..87221de9f5 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs
@@ -292,7 +292,7 @@ namespace MonoDevelop.Projects
stopper.Dispose ();
if (oper.ExitCode != 0) {
- monitor.ReportError ("Custom command failed (exit code: " + oper.ExitCode + ")", null);
+ monitor.ReportError (GettextCatalog.GetString ("Custom command failed (exit code: {0})", oper.ExitCode), null);
}
} catch (Win32Exception w32ex) {
monitor.ReportError (GettextCatalog.GetString ("Failed to execute custom command '{0}': {1}",
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
index 4bcc7e1adf..4900c1567a 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
@@ -581,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) {
@@ -832,7 +832,7 @@ namespace MonoDevelop.Projects
/// <param name="configuration">
/// Configuration for which to get the assemblies.
/// </param>
- public Task<IEnumerable<string>> GetReferencedAssemblies (ConfigurationSelector configuration)
+ public Task<IEnumerable<AssemblyReference>> GetReferencedAssemblies (ConfigurationSelector configuration)
{
return GetReferencedAssemblies (configuration, true);
}
@@ -847,15 +847,15 @@ 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 Task<IEnumerable<string>> GetReferencedAssemblies (ConfigurationSelector configuration, bool includeProjectReferences)
+ public Task<IEnumerable<AssemblyReference>> GetReferencedAssemblies (ConfigurationSelector configuration, bool includeProjectReferences)
{
- return BindTask<IEnumerable<string>> (async ct => {
+ return BindTask<IEnumerable<AssemblyReference>> (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))
- res.Add (asm);
+ foreach (var asm in pref.GetReferencedFileNames (configuration))
+ res.Add (new AssemblyReference (asm, pref.Aliases));
}
}
return res;
@@ -872,16 +872,16 @@ namespace MonoDevelop.Projects
return ProjectExtension.OnGetReferencedAssemblyProjects (configuration);
}
- internal protected virtual async Task<List<string>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
+ internal protected virtual async Task<List<AssemblyReference>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
{
- List<string> result = new List<string> ();
+ List<AssemblyReference> result = new List<AssemblyReference> ();
if (CheckUseMSBuildEngine (configuration)) {
// Get the references list from the msbuild project
RemoteProjectBuilder builder = await GetProjectBuilder ();
try {
var configs = GetConfigurations (configuration, false);
- string [] refs;
+ AssemblyReference [] refs;
using (Counters.ResolveMSBuildReferencesTimer.BeginTiming (GetProjectEventMetadata (configuration)))
refs = await builder.ResolveAssemblyReferences (configs, CancellationToken.None);
foreach (var r in refs)
@@ -893,19 +893,19 @@ namespace MonoDevelop.Projects
foreach (ProjectReference pref in References) {
if (pref.ReferenceType != ReferenceType.Project) {
foreach (string asm in pref.GetReferencedFileNames (configuration))
- result.Add (asm);
+ result.Add (new AssemblyReference (asm, pref.Aliases));
}
}
var mscorlib = AssemblyContext.GetAssemblyFullName ("mscorlib", TargetFramework);
var mscorlibPath = AssemblyContext.GetAssemblyLocation (mscorlib, TargetFramework);
- if (!result.Contains (mscorlibPath))
- result.Add (mscorlibPath);
+ if (!result.Any (ar => ar.FilePath == mscorlibPath))
+ result.Add (new AssemblyReference (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);
+ if (!result.Any (ar => ar.FilePath == corePath))
+ result.Add (new AssemblyReference (corePath));
}
}
@@ -917,8 +917,11 @@ namespace MonoDevelop.Projects
// 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)
- result.Add (sa.Location);
+ if (sa != null) {
+ var ar = new AssemblyReference (sa.Location);
+ if (!result.Contains (ar))
+ result.Add (ar);
+ }
}
var addFacadeAssemblies = false;
foreach (var r in GetReferencedAssemblyProjects (configuration)) {
@@ -930,10 +933,10 @@ namespace MonoDevelop.Projects
if (!addFacadeAssemblies) {
foreach (var refFilename in result) {
string fullPath = null;
- if (!Path.IsPathRooted (refFilename)) {
- fullPath = Path.Combine (Path.GetDirectoryName (FileName), refFilename);
+ if (!Path.IsPathRooted (refFilename.FilePath)) {
+ fullPath = Path.Combine (Path.GetDirectoryName (FileName), refFilename.FilePath);
} else {
- fullPath = Path.GetFullPath (refFilename);
+ fullPath = Path.GetFullPath (refFilename.FilePath);
}
if (SystemAssemblyService.ContainsReferenceToSystemRuntime (fullPath)) {
addFacadeAssemblies = true;
@@ -948,7 +951,9 @@ namespace MonoDevelop.Projects
foreach (var facade in facades) {
if (!File.Exists (facade))
continue;
- result.Add (facade);
+ var ar = new AssemblyReference (facade);
+ if (!result.Contains (ar))
+ result.Add (ar);
}
}
return result;
@@ -1637,7 +1642,7 @@ namespace MonoDevelop.Projects
return Project.OnGetDefaultTargetPlatform (projectCreateInfo);
}
- internal protected override Task<List<string>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
+ internal protected override Task<List<AssemblyReference>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
{
return Project.OnGetReferencedAssemblies (configuration);
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs
index 1bf92a0cfb..51e5a24b4f 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs
@@ -72,7 +72,7 @@ namespace MonoDevelop.Projects
return next.OnGetDefaultTargetPlatform (projectCreateInfo);
}
- internal protected virtual Task<List<string>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
+ internal protected virtual Task<List<AssemblyReference>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
{
return next.OnGetReferencedAssemblies (configuration);
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs
index e08223f506..3258b9aca8 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs
@@ -29,6 +29,7 @@
using System.Xml;
using System.Collections.Generic;
using System.Collections.Immutable;
+using MonoDevelop.Core;
namespace MonoDevelop.Projects
{
@@ -60,6 +61,12 @@ namespace MonoDevelop.Projects
base.OnGetTypeTags (types);
types.Add ("GenericProject");
}
+
+ protected override void OnWriteConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet pset)
+ {
+ base.OnWriteConfiguration (monitor, config, pset);
+ pset.SetValue ("OutputPath", config.OutputDirectory);
+ }
}
[ProjectModelDataItem]
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs
index 6ffc5cb2e2..90890d57ff 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs
@@ -76,10 +76,10 @@ namespace MonoDevelop.Projects
return new TargetFrameworkMoniker (".NETPortable", "4.5", "Profile78");
}
- internal protected override async Task<List<string>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
+ internal protected override async Task<List<AssemblyReference>> 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);
+ var asms = Project.TargetRuntime.AssemblyContext.GetAssemblies (Project.TargetFramework).Where (a => a.Package.IsFrameworkPackage).Select (a => new AssemblyReference (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 c17a026bc0..dc3dff4ed1 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
@@ -378,6 +378,7 @@ namespace MonoDevelop.Projects
foreach (var projectFile in projectFiles) {
var info = new FileInfo (projectFile.FilePath);
infoList.Add (info);
+ info.Refresh ();
}
return infoList;
@@ -1436,7 +1437,7 @@ namespace MonoDevelop.Projects
//copy references and files marked to "CopyToOutputDirectory"
CopySupportFiles (monitor, configuration);
- monitor.Log.WriteLine ("Performing main compilation...");
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Performing main compilation…"));
BuildResult res = await DoBuild (monitor, configuration);
@@ -2128,7 +2129,7 @@ namespace MonoDevelop.Projects
string itemGuid = msproject.EvaluatedProperties.GetValue ("ProjectGuid");
if (itemGuid == null)
- throw new UserException ("Project file doesn't have a valid ProjectGuid");
+ throw new UserException (GettextCatalog.GetString ("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.
@@ -2744,7 +2745,7 @@ namespace MonoDevelop.Projects
var include = GetPrefixedInclude (pathPrefix, item.UnevaluatedInclude ?? item.Include);
MSBuildItem buildItem;
- if (item.BackingItem != null && item.BackingItem.Name == item.ItemName) {
+ if (item.BackingItem?.ParentObject != null && item.BackingItem.Name == item.ItemName) {
buildItem = item.BackingItem;
} else {
buildItem = msproject.AddNewItem (item.ItemName, include);
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
index 8c0dc3ec33..9ec1fe38f6 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
@@ -238,9 +238,9 @@ namespace MonoDevelop.Projects
foreach (FilePath f in newFiles) {
if (!f.IsChildPathOf (resolvedTargetPath)) {
if (obj is Solution)
- monitor.ReportError ("The solution '" + obj.Name + "' is referencing the file '" + f.FileName + "' which is located outside the root solution directory.", null);
+ monitor.ReportError (GettextCatalog.GetString ("The solution '{0}' is referencing the file '{1}' which is located outside the root solution directory.", obj.Name, f.FileName), null);
else
- monitor.ReportError ("The project '" + obj.Name + "' is referencing the file '" + f.FileName + "' which is located outside the project directory.", null);
+ monitor.ReportError (GettextCatalog.GetString ("The project '{0}' is referencing the file '{1}' which is located outside the project directory.", obj.Name, f.FileName), null);
}
oldFiles.Remove (f);
}
@@ -308,9 +308,9 @@ namespace MonoDevelop.Projects
if (ignoreExternalFiles)
continue;
if (obj is Solution)
- monitor.ReportError ("The solution '" + obj.Name + "' is referencing the file '" + Path.GetFileName (file) + "' which is located outside the root solution directory.", null);
+ monitor.ReportError (GettextCatalog.GetString ("The solution '{0}' is referencing the file '{1}' which is located outside the root solution directory.", obj.Name, Path.GetFileName (file)), null);
else
- monitor.ReportError ("The project '" + obj.Name + "' is referencing the file '" + Path.GetFileName (file) + "' which is located outside the project directory.", null);
+ monitor.ReportError (GettextCatalog.GetString ("The project '{0}' is referencing the file '{1}' which is located outside the project directory.", obj.Name, Path.GetFileName (file)), null);
return false;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs
index 23f0870053..05a406c308 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs
@@ -750,7 +750,7 @@ namespace MonoDevelop.Projects
if (!it.CanExecute (context, configuration))
continue;
AggregatedProgressMonitor mon = new AggregatedProgressMonitor ();
- mon.AddSlaveMonitor (monitor, MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.SlaveCancel);
+ mon.AddFollowerMonitor (monitor, MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.FollowerCancel);
monitors.Add (mon);
tasks.Add (it.Execute (mon, context, configuration));
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs
index 4e7fb71428..26ca11893d 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs
@@ -638,6 +638,10 @@ namespace MonoDevelop.Projects
BuildResult cres = new BuildResult ();
cres.BuildCount = 0;
+ // Limit the number of concurrent builders to processors / 2
+
+ var slotScheduler = new TaskSlotScheduler (Environment.ProcessorCount / 2);
+
// Create a dictionary with the status objects of all items
var buildStatus = ImmutableDictionary<SolutionItem, BuildStatus>.Empty;
@@ -672,7 +676,8 @@ namespace MonoDevelop.Projects
if (!ignoreFailed && (refStatus.Any (bs => bs.Failed) || t.IsFaulted)) {
myStatus.Failed = true;
} else {
- myStatus.Result = await buildAction (myMonitor, item);
+ using (await slotScheduler.GetTaskSlot ())
+ myStatus.Result = await buildAction (myMonitor, item);
myStatus.Failed = myStatus.Result != null && myStatus.Result.ErrorCount > 0;
}
myMonitor.Dispose ();
@@ -1111,4 +1116,64 @@ namespace MonoDevelop.Projects
get { return this.file; }
}
}
+
+ /// <summary>
+ /// Keeps track of slots available for executing an operation
+ /// </summary>
+ class TaskSlotScheduler
+ {
+ int freeSlots;
+ Queue<TaskCompletionSource<IDisposable>> waitQueue = new Queue<TaskCompletionSource<IDisposable>> ();
+
+ class Slot: IDisposable
+ {
+ public TaskSlotScheduler TaskSlotScheduler;
+
+ public void Dispose ()
+ {
+ if (TaskSlotScheduler != null) {
+ TaskSlotScheduler.FreeSlot ();
+ TaskSlotScheduler = null;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:MonoDevelop.Projects.TaskSlotScheduler"/> class.
+ /// </summary>
+ /// <param name="slots">Initial number of slots available</param>
+ public TaskSlotScheduler (int slots)
+ {
+ freeSlots = Math.Max (slots, 1);
+ }
+
+ /// <summary>
+ /// Gets a slot, to be disposed when done with the operation
+ /// </summary>
+ /// <returns>The task slot.</returns>
+ public Task<IDisposable> GetTaskSlot ()
+ {
+ lock (waitQueue) {
+ if (freeSlots > 0) {
+ freeSlots--;
+ return Task.FromResult ((IDisposable)new Slot { TaskSlotScheduler = this });
+ } else {
+ var cs = new TaskCompletionSource<IDisposable> ();
+ waitQueue.Enqueue (cs);
+ return cs.Task;
+ }
+ }
+ }
+
+ void FreeSlot ()
+ {
+ lock (waitQueue) {
+ if (waitQueue.Count > 0) {
+ var cs = waitQueue.Dequeue ();
+ cs.SetResult (new Slot { TaskSlotScheduler = this });
+ } else
+ freeSlots++;
+ }
+ }
+ }
}
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 c657d97264..7a20215bb0 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml
@@ -40,6 +40,13 @@
<Description>A subclass of MonoDevelop.Components.Commands.CommandHandler</Description>
</ExtensionNode>
</ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/Ide/PreStartupHandlers" name = "Pre-startup handlers">
+ <Description>Commands to be automatically executed before the IDE UI is initialized. </Description>>
+ <ExtensionNode name="Class" objectType="MonoDevelop.Components.Commands.CommandHandler" customAttributeType="MonoDevelop.Ide.Extensions.StartupHandlerExtensionAttribute">
+ <Description>A subclass of MonoDevelop.Components.Commands.CommandHandler</Description>
+ </ExtensionNode>
+ </ExtensionPoint>
<ExtensionPoint path = "/MonoDevelop/Ide/InitCompleteHandlers" name = "Post inialization handlers">
<Description>Commands to be automatically executed when the IDE finishes initalization.</Description>
@@ -170,11 +177,6 @@
<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" />
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 629a3e2eeb..60f7c13e17 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
@@ -257,6 +257,44 @@ namespace MonoDevelop.Components.AutoTest.Results
return true;
}
+ void SendButtonEvent (Widget target, Gdk.EventType eventType, double x, double y, Gdk.ModifierType state, uint button)
+ {
+ Gdk.Window win = target.GdkWindow;
+
+ int rx, ry;
+ win.GetRootOrigin (out rx, out ry);
+
+ var nativeEvent = new NativeEventButtonStruct {
+ type = eventType,
+ send_event = 1,
+ window = win.Handle,
+ state = (uint)state,
+ button = button,
+ x = x,
+ y = y,
+ axes = IntPtr.Zero,
+ device = IntPtr.Zero,
+ time = Global.CurrentEventTime,
+ x_root = x + rx,
+ y_root = y + ry
+ };
+
+ IntPtr ptr = GLib.Marshaller.StructureToPtrAlloc (nativeEvent);
+ try {
+ Gdk.EventHelper.Put (new Gdk.EventButton (ptr));
+ } finally {
+ Marshal.FreeHGlobal (ptr);
+ }
+ }
+
+ public override bool Click (double x, double y)
+ {
+ SendButtonEvent (resultWidget, Gdk.EventType.ButtonPress, x, y, 0, 1);
+ SendButtonEvent (resultWidget, Gdk.EventType.ButtonRelease, x, y, 0, 1);
+
+ return true;
+ }
+
void SendKeyEvent (Gtk.Widget target, uint keyval, Gdk.ModifierType state, Gdk.EventType eventType, string subWindow)
{
Gdk.KeymapKey[] keyms = Gdk.Keymap.Default.GetEntriesForKeyval (keyval);
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 bcd17d7f81..ea5a214bd8 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
@@ -181,6 +181,11 @@ namespace MonoDevelop.Components.AutoTest.Results
return true;
}
+ public override bool Click (double x, double y)
+ {
+ return Click ();
+ }
+
NSEvent MakeEvent (string c, NSEventType type, double epochTime, nint winID)
{
return NSEvent.KeyEvent (type, CoreGraphics.CGPoint.Empty,
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 fc276a5394..b96c6978e0 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
@@ -98,6 +98,11 @@ namespace MonoDevelop.Components.AutoTest.Results
return false;
}
+ public override bool Click (double x, double y)
+ {
+ return false;
+ }
+
public override bool TypeKey (char key, string state = "")
{
return false;
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 df759e541b..1f7becc830 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs
@@ -59,6 +59,7 @@ namespace MonoDevelop.Components.AutoTest
// Actions
public abstract bool Select ();
public abstract bool Click ();
+ public abstract bool Click (double x, double y);
public abstract bool TypeKey (char key, string state = "");
public abstract bool TypeKey (string keyString, string state = "");
public abstract bool EnterText (string text);
@@ -151,6 +152,7 @@ namespace MonoDevelop.Components.AutoTest
{
var propertiesObject = new ObjectProperties ();
if (resultObject != null) {
+ propertiesObject.Add ("ToString", new ObjectResult (resultObject.ToString ()), null);
var properties = resultObject.GetType ().GetProperties (
BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
foreach (var property in properties) {
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 e3251563aa..6e2fc2052e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs
@@ -304,6 +304,16 @@ namespace MonoDevelop.Components.AutoTest
return false;
}
+ public bool ClickElement (Func<AppQuery, AppQuery> query, double x, double y, bool wait = true)
+ {
+ AppResult [] results = Query (query);
+ if (results.Length > 0) {
+ return session.Click (results [0], x, y, wait);
+ }
+
+ return false;
+ }
+
public bool EnterText (Func<AppQuery, AppQuery> query, string text)
{
AppResult[] results = Query (query);
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 66072db1b4..01dd6adfe7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs
@@ -512,6 +512,21 @@ namespace MonoDevelop.Components.AutoTest
return success;
}
+ public bool Click (AppResult result, double x, double y, bool wait = true)
+ {
+ bool success = false;
+
+ try {
+ ExecuteOnIdle (() => {
+ success = result.Click (x, y);
+ }, wait);
+ } catch (TimeoutException e) {
+ ThrowOperationTimeoutException ("Click", result.SourceQuery, result, e);
+ }
+
+ return success;
+ }
+
public bool EnterText (AppResult result, string text)
{
try {
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 951492df32..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,6 +31,7 @@ using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using MonoDevelop.Components.Commands.ExtensionNodes;
@@ -2245,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 ());
}
}
@@ -2277,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.DockNotebook/DockNotebook.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
index 3635a07a71..cb54ea9035 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
@@ -238,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);
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 c8ef193d46..62874505e5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
@@ -73,14 +73,12 @@ namespace MonoDevelop.Components.DockNotebook
public Button NextButton;
public MenuButton DropDownButton;
- static readonly double PixelScale = GtkWorkarounds.GetPixelScale ();
- static readonly int TotalHeight = (int)(32 * PixelScale);
+ static readonly int TotalHeight = 32;
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);
- // static readonly int ButtonSize = (int)(16 * PixelScale);
+ static readonly int LeftBarPadding = 44;
+ static readonly int RightBarPadding = 22;
+ static readonly int VerticalTextSize = 11;
const int TabSpacing = 0;
const int LeanWidth = 12;
const double CloseButtonMarginRight = 0;
@@ -166,6 +164,7 @@ namespace MonoDevelop.Components.DockNotebook
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;
@@ -175,10 +174,12 @@ namespace MonoDevelop.Components.DockNotebook
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;
@@ -836,8 +837,8 @@ namespace MonoDevelop.Components.DockNotebook
ctx.SetSource (lg);
Pango.CairoHelper.ShowLayout (ctx, la.GetLine (0).Layout);
}
- }
- la.Dispose ();
+ }
+ la.Dispose ();
}
static void DrawTabBackground (Widget widget, Context ctx, Gdk.Rectangle allocation, int contentWidth, int px, bool active = true)
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 b4cb07dfd6..94ced4e57d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs
@@ -362,7 +362,7 @@ namespace MonoDevelop.Components.Docking
if (autoHideTimeout == uint.MaxValue) {
autoHideTimeout = GLib.Timeout.Add (force ? 0 : bar.Frame.AutoHideDelay, delegate {
// Don't hide if the context menu for the item is being shown.
- if (it.ShowingContextMemu)
+ if (it.ShowingContextMenu)
return true;
// Don't hide the item if it has the focus. Try again later.
if (it.Widget.FocusChild != null && !force && autoShowFrame != null && ((Gtk.Window)autoShowFrame.Toplevel).HasToplevelFocus)
@@ -437,7 +437,7 @@ namespace MonoDevelop.Components.Docking
if (bar.Frame.OverlayWidgetVisible)
return false;
if (evnt.TriggersContextMenu ()) {
- it.ShowDockPopupMenu (evnt.Time);
+ it.ShowDockPopupMenu (this, evnt);
} else if (evnt.Button == 1) {
if (evnt.Type == Gdk.EventType.TwoButtonPress) {
// Instead of changing the state of the pad here, do it when the button is released.
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 c1054eec77..ceec861e19 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
@@ -526,54 +526,47 @@ namespace MonoDevelop.Components.Docking
}
}
- internal bool ShowingContextMemu { get ; set; }
-
- internal void ShowDockPopupMenu (uint time)
+ internal bool ShowingContextMenu { get ; set; }
+
+ internal void ShowDockPopupMenu (Gtk.Widget parent, Gdk.EventButton evt)
{
- Gtk.Menu menu = new Gtk.Menu ();
-
+ var menu = new ContextMenu ();
+ ContextMenuItem citem;
+
// Hide menuitem
if ((Behavior & DockItemBehavior.CantClose) == 0) {
- Gtk.MenuItem mitem = new Gtk.MenuItem (Catalog.GetString("Hide"));
- mitem.Activated += delegate { Visible = false; };
- menu.Append (mitem);
+ citem = new ContextMenuItem (Catalog.GetString ("Hide"));
+ citem.Clicked += delegate { Visible = false; };
+ menu.Add (citem);
}
- Gtk.MenuItem citem;
-
// Auto Hide menuitem
if ((Behavior & DockItemBehavior.CantAutoHide) == 0 && Status != DockItemStatus.AutoHide) {
- citem = new Gtk.MenuItem (Catalog.GetString("Minimize"));
- citem.Activated += delegate { Status = DockItemStatus.AutoHide; };
- menu.Append (citem);
+ citem = new ContextMenuItem (Catalog.GetString ("Minimize"));
+ citem.Clicked += delegate { Status = DockItemStatus.AutoHide; };
+ menu.Add (citem);
}
if (Status != DockItemStatus.Dockable) {
// Dockable menuitem
- citem = new Gtk.MenuItem (Catalog.GetString("Dock"));
- citem.Activated += delegate { Status = DockItemStatus.Dockable; };
- menu.Append (citem);
+ citem = new ContextMenuItem (Catalog.GetString ("Dock"));
+ citem.Clicked += delegate { Status = DockItemStatus.Dockable; };
+ menu.Add (citem);
}
// Floating menuitem
if ((Behavior & DockItemBehavior.NeverFloating) == 0 && Status != DockItemStatus.Floating) {
- citem = new Gtk.MenuItem (Catalog.GetString("Undock"));
- citem.Activated += delegate { Status = DockItemStatus.Floating; };
- menu.Append (citem);
+ citem = new ContextMenuItem (Catalog.GetString ("Undock"));
+ citem.Clicked += delegate { Status = DockItemStatus.Floating; };
+ menu.Add (citem);
}
- if (menu.Children.Length == 0) {
- menu.Destroy ();
+ if (menu.Items.Count == 0) {
return;
}
- ShowingContextMemu = true;
-
- menu.ShowAll ();
- menu.Hidden += (o,e) => {
- ShowingContextMemu = false;
- };
- menu.Popup (null, null, null, 3, time);
+ ShowingContextMenu = true;
+ menu.Show (parent, evt, () => { ShowingContextMenu = true; });
}
}
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 f28e569089..b2c08ec19b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
@@ -65,8 +65,6 @@ namespace MonoDevelop.Components.Docking
static Xwt.Drawing.Image pixAutoHide;
static Xwt.Drawing.Image pixDock;
- static double PixelScale = GtkWorkarounds.GetPixelScale ();
-
static readonly Xwt.WidgetSpacing TabPadding;
static readonly Xwt.WidgetSpacing TabActivePadding;
@@ -129,7 +127,7 @@ namespace MonoDevelop.Components.Docking
{
double inactiveIconAlpha;
- if (IdeApp.Preferences == null || IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ if (IdeApp.Preferences == null || IdeApp.Preferences.UserInterfaceTheme == Theme.Light)
inactiveIconAlpha = 0.8;
else
inactiveIconAlpha = 0.6;
@@ -164,7 +162,7 @@ namespace MonoDevelop.Components.Docking
WidthRequest = r;
if (visualStyle != null)
- HeightRequest = visualStyle.PadTitleHeight != null ? (int)(visualStyle.PadTitleHeight.Value * PixelScale) : -1;
+ HeightRequest = visualStyle.PadTitleHeight != null ? (int)(visualStyle.PadTitleHeight.Value) : -1;
}
public void SetLabel (Gtk.Widget page, Xwt.Drawing.Image icon, string label)
@@ -190,6 +188,7 @@ namespace MonoDevelop.Components.Docking
if (!string.IsNullOrEmpty (label)) {
labelWidget = new ExtendedLabel (label);
labelWidget.UseMarkup = true;
+ labelWidget.Name = label;
var alignLabel = new Alignment (0.0f, 0.5f, 1, 1);
alignLabel.BottomPadding = 0;
alignLabel.RightPadding = 15;
@@ -207,6 +206,7 @@ namespace MonoDevelop.Components.Docking
btnDock.Clicked += OnClickDock;
btnDock.ButtonPressEvent += (o, args) => args.RetVal = true;
btnDock.WidthRequest = btnDock.SizeRequest ().Width;
+ btnDock.Name = string.Format("btnDock_{0}", label ?? string.Empty);
btnClose = new ImageButton ();
btnClose.Image = pixClose;
@@ -218,6 +218,7 @@ namespace MonoDevelop.Components.Docking
item.Visible = false;
};
btnClose.ButtonPressEvent += (o, args) => args.RetVal = true;
+ btnClose.Name = string.Format ("btnClose_{0}", label ?? string.Empty);
Gtk.Alignment al = new Alignment (0, 0.5f, 1, 1);
HBox btnBox = new HBox (false, 0);
@@ -300,7 +301,7 @@ namespace MonoDevelop.Components.Docking
protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
{
if (evnt.TriggersContextMenu ()) {
- item.ShowDockPopupMenu (evnt.Time);
+ item.ShowDockPopupMenu (this, evnt);
return false;
} else if (evnt.Button == 1) {
if (evnt.Type == Gdk.EventType.ButtonPress) {
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.MainToolbar/FirstCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FirstCategory.cs
deleted file mode 100644
index 2c483538df..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FirstCategory.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace MonoDevelop.Components.MainToolbar
-{
- class FirstCategory
- {
- }
-} \ No newline at end of file
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 1c2d601edf..38ed0648e0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
@@ -182,12 +182,10 @@ namespace MonoDevelop.Components.MainToolbar
if (toplevel == null)
return;
- var pixel_scale = GtkWorkarounds.GetPixelScale ();
-
int windowWidth = toplevel.Allocation.Width;
int center = windowWidth / 2;
- int left = Math.Max (center - (int)(300 * pixel_scale), args.Allocation.Left);
- int right = Math.Min (left + (int)(600 * pixel_scale), args.Allocation.Right);
+ int left = Math.Max (center - 300, args.Allocation.Left);
+ int right = Math.Min (left + 600, args.Allocation.Right);
uint left_padding = (uint) (left - args.Allocation.Left);
uint right_padding = (uint) (args.Allocation.Right - right);
@@ -229,7 +227,7 @@ namespace MonoDevelop.Components.MainToolbar
align.Add (contentBox);
Add (align);
- SetDefaultSizes (-1, (int)(21 * GtkWorkarounds.GetPixelScale ()));
+ SetDefaultSizes (-1, 21);
configurationCombo.Changed += (o, e) => {
if (ConfigurationChanged != null)
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 c6fd6fd3c2..56712743e5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs
@@ -594,7 +594,7 @@ namespace MonoDevelop.Components.MainToolbar
IdeApp.Workbench.Present ();
var text = lastSearchText;
var actDoc = IdeApp.Workbench.ActiveDocument;
- if (actDoc != null && actDoc.Editor.IsSomethingSelected) {
+ if (actDoc != null && actDoc.Editor != null && actDoc.Editor.IsSomethingSelected) {
string selected = actDoc.Editor.SelectedText;
int whitespaceIndex = selected.TakeWhile (c => !char.IsWhiteSpace (c)).Count ();
text = selected.Substring (0, whitespaceIndex);
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 c4a1afe7e9..a76ccc18ed 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
@@ -90,7 +90,7 @@ namespace MonoDevelop.Components.MainToolbar
var options = new FilterOptions ();
if (PropertyService.Get ("AutoSetPatternCasing", true))
options.CaseSensitive = pattern.Pattern.Any (c => char.IsUpper (c));
- FindInFilesDialog.SearchReplace (pattern.Pattern, null, new WholeSolutionScope (), options, null);
+ FindInFilesDialog.SearchReplace (pattern.Pattern, null, new WholeSolutionScope (), options, null, null);
}
public override string GetMarkupText (bool selected)
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 bd083c55ee..f1e61b9ec1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs
@@ -347,7 +347,7 @@ namespace MonoDevelop.Components.MainToolbar
TaskService.Errors.TasksAdded += updateHandler;
TaskService.Errors.TasksRemoved += updateHandler;
- currentApplicationName = BrandingService.ApplicationName;
+ currentApplicationName = BrandingService.ApplicationLongName;
BrandingService.ApplicationNameChanged += ApplicationNameChanged;
box.Destroyed += delegate {
@@ -375,11 +375,11 @@ namespace MonoDevelop.Components.MainToolbar
void ApplicationNameChanged (object sender, EventArgs e)
{
if (renderArg.CurrentText == currentApplicationName) {
- LoadText (BrandingService.ApplicationName, false);
+ LoadText (BrandingService.ApplicationLongName, false);
LoadPixbuf (null);
QueueDraw ();
}
- currentApplicationName = BrandingService.ApplicationName;
+ currentApplicationName = BrandingService.ApplicationLongName;
}
protected override void OnRealized ()
@@ -436,6 +436,7 @@ namespace MonoDevelop.Components.MainToolbar
public void ShowReady ()
{
ShowMessage ("");
+ SetMessageSourcePad (null);
}
public void SetMessageSourcePad (Pad pad)
@@ -721,7 +722,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;
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 14b676134e..4152f67dd1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs
@@ -143,7 +143,7 @@ namespace MonoDevelop.Components.PropertyGrid
base.PackEnd (vpaned);
base.FocusChain = new Gtk.Widget [] { vpaned };
- Populate ();
+ Populate (saveEditSession: false);
UpdateTabs ();
}
@@ -188,7 +188,7 @@ namespace MonoDevelop.Components.PropertyGrid
TabRadioToolButton button = (TabRadioToolButton) sender;
if (selectedTab == button.Tab) return;
selectedTab = button.Tab;
- Populate ();
+ Populate (saveEditSession: true);
}
// 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.
@@ -200,7 +200,7 @@ namespace MonoDevelop.Components.PropertyGrid
set {
if (value != propertySort) {
propertySort = value;
- Populate ();
+ Populate (saveEditSession: true);
}
}
}
@@ -262,7 +262,7 @@ namespace MonoDevelop.Components.PropertyGrid
this.currentObject = obj;
this.propertyProviders = propertyProviders;
UpdateTabs ();
- Populate();
+ Populate(saveEditSession: false);
}
public void CommitPendingChanges ()
@@ -287,11 +287,13 @@ namespace MonoDevelop.Components.PropertyGrid
QueueDraw ();
}
- internal void Populate ()
+ internal void Populate (bool saveEditSession)
{
PropertyDescriptorCollection properties;
- tree.SaveStatus ();
+ tree.SaveStatus ();
+ if (saveEditSession)
+ tree.SaveEditSession ();
tree.Clear ();
tree.PropertySort = propertySort;
@@ -304,8 +306,9 @@ namespace MonoDevelop.Components.PropertyGrid
properties = selectedTab.GetProperties (prov);
tree.Populate (properties, prov);
}
- }
+ }
tree.RestoreStatus ();
+ tree.RestoreEditSession ();
}
void Update ()
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 30feb1e47f..57bed7052a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs
@@ -162,6 +162,8 @@ namespace MonoDevelop.Components.PropertyGrid
}
Dictionary<object,List<string>> expandedStatus;
+ PropertyDescriptor lastEditedProperty;
+ EditSession lastEditSession;
class ReferenceEqualityComparer<T> : IEqualityComparer<T>
{
@@ -181,6 +183,7 @@ namespace MonoDevelop.Components.PropertyGrid
//since the tree can be built dynamically, and there can be multiple instances of each type.
//make a best attempt using reference equality to match objects and the name to match their properties.
expandedStatus = new Dictionary<object,List<string>>(new ReferenceEqualityComparer<object> ());
+
foreach (var r in rows.Where (r => r.IsExpandable)) {
object key;
string val;
@@ -234,6 +237,49 @@ namespace MonoDevelop.Components.PropertyGrid
QueueResize ();
}
+ internal void SaveEditSession ()
+ {
+ if (editSession == null)
+ return;
+
+ lastEditedProperty = editSession.Property;
+ lastEditSession = editSession;
+
+ // Set the edit session to null explicitly so Clear does not end the edit session.
+ editSession = null;
+ }
+
+ internal void RestoreEditSession ()
+ {
+ if (lastEditedProperty == null || lastEditSession == null)
+ return;
+
+ var newEditRow = FindRow (rows, lastEditedProperty);
+ if (newEditRow != null) {
+ currentEditorRow = newEditRow;
+ editSession = lastEditSession;
+ } else {
+ editSession = lastEditSession;
+ EndEditing ();
+ }
+
+ lastEditedProperty = null;
+ lastEditSession = null;
+ }
+
+ static TableRow FindRow (IEnumerable<TableRow> rows, PropertyDescriptor property)
+ {
+ foreach (var row in rows) {
+ if (row.Property == property)
+ return row;
+
+ var childRes = FindRow (row.ChildRows, property);
+ if (childRes != null)
+ return childRes;
+ }
+ return null;
+ }
+
public virtual void Clear ()
{
heightMeasured = false;
@@ -782,7 +828,7 @@ namespace MonoDevelop.Components.PropertyGrid
base.OnDragLeave (context, time_);
}
- void EndEditing ()
+ internal void EndEditing ()
{
if (editSession != null) {
Remove (currentEditor);
@@ -818,7 +864,7 @@ namespace MonoDevelop.Components.PropertyGrid
if (refresh == RefreshProperties.Repaint) {
parentGrid.Refresh ();
} else if (refresh == RefreshProperties.All) {
- parentGrid.Populate();
+ parentGrid.Populate(saveEditSession: true);
}
if (Changed != null)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs
index 743b2fe187..7a51a958e7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs
@@ -28,7 +28,7 @@
using System;
using System.Collections.Generic;
-using System.Threading.Tasks;
+
using Gtk;
using MonoDevelop.Core;
@@ -105,9 +105,9 @@ namespace MonoDevelop.Components
public string PromptMultiLineString { get; set; }
[GLib.ConnectBeforeAttribute]
- async void TextViewKeyPressEvent (object o, KeyPressEventArgs args)
+ void TextViewKeyPressEvent (object o, KeyPressEventArgs args)
{
- if (await ProcessKeyPressEvent (args))
+ if (ProcessKeyPressEvent (args))
args.RetVal = true;
}
@@ -198,12 +198,12 @@ namespace MonoDevelop.Components
return true;
}
- protected virtual Task<bool> ProcessKeyPressEvent (KeyPressEventArgs args)
+ protected virtual bool ProcessKeyPressEvent (KeyPressEventArgs args)
{
// Short circuit to avoid getting moved back to the input line
// when paging up and down in the shell output
if (args.Event.Key == Gdk.Key.Page_Up || args.Event.Key == Gdk.Key.Page_Down)
- return Task.FromResult (false);
+ return false;
// Needed so people can copy and paste, but always end up
// typing in the prompt.
@@ -213,7 +213,7 @@ namespace MonoDevelop.Components
}
if (!TextView.Editable) {
- return Task.FromResult (false);
+ return false;
}
// if (ev.State == Gdk.ModifierType.ControlMask && ev.Key == Gdk.Key.space)
@@ -222,13 +222,13 @@ namespace MonoDevelop.Components
switch (args.Event.Key) {
case Gdk.Key.KP_Enter:
case Gdk.Key.Return:
- return Task.FromResult (ProcessReturn ());
+ return ProcessReturn ();
case Gdk.Key.KP_Up:
case Gdk.Key.Up:
- return Task.FromResult (ProcessCommandHistoryUp ());
+ return ProcessCommandHistoryUp ();
case Gdk.Key.KP_Down:
case Gdk.Key.Down:
- return Task.FromResult (ProcessCommandHistoryDown ());
+ return ProcessCommandHistoryDown ();
case Gdk.Key.KP_Left:
case Gdk.Key.Left:
// On Mac, when using a small keyboard, Home is Command+Left
@@ -239,12 +239,12 @@ namespace MonoDevelop.Components
if (!args.Event.State.HasFlag (Gdk.ModifierType.ShiftMask))
Buffer.MoveMark (Buffer.SelectionBound, InputLineBegin);
- return Task.FromResult (true);
+ return true;
}
// Keep our cursor inside the prompt area
if (Cursor.Compare (InputLineBegin) <= 0)
- return Task.FromResult (true);
+ return true;
break;
case Gdk.Key.KP_Home:
@@ -255,7 +255,7 @@ namespace MonoDevelop.Components
if (!args.Event.State.HasFlag (Gdk.ModifierType.ShiftMask))
Buffer.MoveMark (Buffer.SelectionBound, InputLineBegin);
- return Task.FromResult (true);
+ return true;
case Gdk.Key.a:
if (args.Event.State.HasFlag (Gdk.ModifierType.ControlMask)) {
Buffer.MoveMark (Buffer.InsertMark, InputLineBegin);
@@ -264,16 +264,16 @@ namespace MonoDevelop.Components
if (!args.Event.State.HasFlag (Gdk.ModifierType.ShiftMask))
Buffer.MoveMark (Buffer.SelectionBound, InputLineBegin);
- return Task.FromResult (true);
+ return true;
}
break;
case Gdk.Key.period:
- return Task.FromResult (false);
+ return false;
default:
- return Task.FromResult (false);
+ return false;
}
- return Task.FromResult (false);
+ return false;
}
public TextIter InputLineBegin {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs
index c1ec98b799..8c4bef84e5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs
@@ -54,6 +54,18 @@ namespace MonoDevelop.Components
base.OnDragBegin (context);
}
+ protected override void OnRowActivated (Gtk.TreePath path, Gtk.TreeViewColumn column)
+ {
+ // This is to work around an issue in ContextMenuTreeView, when we set the
+ // SelectFunction to block selection then it doesn't seem to always get
+ // properly unset.
+ // https://bugzilla.xamarin.com/show_bug.cgi?id=40469
+ this.Selection.SelectFunction = (s, m, p, b) => {
+ return true;
+ };
+ base.OnRowActivated (path, column);
+ }
+
protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
{
selectOnRelease = false;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
index 8fd9b418a1..73dcd72b2b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
@@ -173,6 +173,8 @@ namespace MonoDevelop.Components
public void GrabFocus ()
{
+ if (nativeWidget is Gtk.Widget)
+ ((Gtk.Widget)nativeWidget).GrabFocus ();
// TODO
}
@@ -192,6 +194,7 @@ namespace MonoDevelop.Components
var gtkWidget = nativeWidget as Gtk.Widget;
if (gtkWidget != null) {
gtkWidget.Destroy ();
+ gtkWidget.Dispose ();
}
#if MAC
else if (nativeWidget is NSView)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs
index 13e9a1419f..7c7cc2361d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs
@@ -65,7 +65,10 @@ namespace MonoDevelop.Components
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));
+ return String.Format("#{0:x2}{1:x2}{2:x2}",
+ (byte)(((double)color.Red / ushort.MaxValue) * 255),
+ (byte)(((double)color.Green / ushort.MaxValue) * 255),
+ (byte)(((double)color.Blue / ushort.MaxValue) * 255));
}
public static Gdk.Color ToGdkColor (this Cairo.Color color)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs
index 668a592c9b..5046ee0b41 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs
@@ -39,6 +39,9 @@ using System.Text.RegularExpressions;
using AppKit;
using MonoDevelop.Components.Mac;
#endif
+#if WIN32
+using System.Windows.Input;
+#endif
namespace MonoDevelop.Components
{
@@ -83,9 +86,6 @@ namespace MonoDevelop.Components
[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;
@@ -379,6 +379,19 @@ namespace MonoDevelop.Components
public static Gdk.ModifierType GetCurrentKeyModifiers ()
{
+ #if WIN32
+ Gdk.ModifierType mtype = Gdk.ModifierType.None;
+ ModifierKeys mod = Keyboard.Modifiers;
+ if ((mod & ModifierKeys.Shift) > 0)
+ mtype |= Gdk.ModifierType.ShiftMask;
+ if ((mod & ModifierKeys.Control) > 0)
+ mtype |= Gdk.ModifierType.ControlMask;
+ if ((mod & ModifierKeys.Alt) > 0)
+ mtype |= Gdk.ModifierType.Mod1Mask; // Alt key
+ if ((mod & ModifierKeys.Windows) > 0)
+ mtype |= Gdk.ModifierType.Mod2Mask; // Command key
+ return mtype;
+ #else
if (Platform.IsMac) {
Gdk.ModifierType mtype = Gdk.ModifierType.None;
ulong mod;
@@ -402,6 +415,7 @@ namespace MonoDevelop.Components
Gtk.Global.GetCurrentEventState (out mtype);
return mtype;
}
+ #endif
}
public static void GetPageScrollPixelDeltas (this Gdk.EventScroll evt, double pageSizeX, double pageSizeY,
@@ -851,19 +865,6 @@ namespace MonoDevelop.Components
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 ();
@@ -1230,21 +1231,6 @@ namespace MonoDevelop.Components
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)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs
index 11c939e6a5..2e93119087 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs
@@ -45,7 +45,7 @@ namespace MonoDevelop.Components
internal static string DefaultGtkDataFolder;
internal static string DefaultGtk2RcFiles;
- public static Skin UserInterfaceSkin { get; private set; }
+ public static Theme UserInterfaceTheme { get; private set; }
static IdeTheme ()
{
@@ -100,7 +100,7 @@ namespace MonoDevelop.Components
if (Platform.IsLinux) {
DefaultTheme = Gtk.Settings.Default.ThemeName;
- string theme = IdeApp.Preferences.UserInterfaceTheme;
+ string theme = IdeApp.Preferences.UserInterfaceThemeName;
if (string.IsNullOrEmpty (theme))
theme = DefaultTheme;
ValidateGtkTheme (ref theme);
@@ -123,12 +123,12 @@ namespace MonoDevelop.Components
if (DefaultTheme == null)
SetupGtkTheme ();
- string current_theme = IdeApp.Preferences.UserInterfaceTheme;
+ string current_theme = IdeApp.Preferences.UserInterfaceThemeName;
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 ();
+ UserInterfaceTheme = IdeApp.Preferences.UserInterfaceThemeName == "Dark" ? Theme.Dark : Theme.Light;
+ if (current_theme != UserInterfaceTheme.ToString ()) // Only theme names allowed on Win/Mac
+ current_theme = UserInterfaceTheme.ToString ();
}
var use_bundled_theme = false;
@@ -183,7 +183,7 @@ namespace MonoDevelop.Components
} else if (Platform.IsMac) {
var gtkrc = "gtkrc.mac";
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark)
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark)
gtkrc += "-dark";
gtkrc = PropertyService.EntryAssemblyPath.Combine (gtkrc);
@@ -219,10 +219,10 @@ namespace MonoDevelop.Components
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;
+ UserInterfaceTheme = HslColor.Brightness (bgColor) < 0.5 ? Theme.Dark : Theme.Light;
}
- if (UserInterfaceSkin == Skin.Dark)
+ if (UserInterfaceTheme == Theme.Dark)
Xwt.Drawing.Context.SetGlobalStyle ("dark");
else
Xwt.Drawing.Context.ClearGlobalStyle ("dark");
@@ -287,12 +287,12 @@ namespace MonoDevelop.Components
static void SetTheme (NSWindow window)
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light)
window.Appearance = NSAppearance.GetAppearance (NSAppearance.NameAqua);
else
window.Appearance = NSAppearance.GetAppearance (NSAppearance.NameVibrantDark);
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light) {
window.StyleMask &= ~NSWindowStyle.TexturedBackground;
return;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageLoader.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageLoader.cs
index 166f3e401b..dccc878c76 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageLoader.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageLoader.cs
@@ -184,8 +184,9 @@ namespace MonoDevelop.Components
lock (mutex) {
if (Downloading)
completed += value;
+ else
+ value (this, EventArgs.Empty);
}
- value (this, EventArgs.Empty);
}
remove {
lock (mutex) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
index efe7bf474f..6760f647d5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
@@ -90,17 +90,13 @@ namespace MonoDevelop.Components
}
}
- double IconScale {
- 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);
+ requisition.Height += (int)(image.Height);
}
}
@@ -125,11 +121,10 @@ namespace MonoDevelop.Components
var alloc = Allocation;
alloc.Inflate (-Xpad, -Ypad);
using (var ctx = CairoHelper.Create (evnt.Window)) {
- var x = Math.Round (alloc.X + (alloc.Width - image.Width * IconScale) * Xalign);
- var y = Math.Round (alloc.Y + (alloc.Height - image.Height * IconScale) * Yalign);
+ var x = Math.Round (alloc.X + (alloc.Width - image.Width) * Xalign);
+ var y = Math.Round (alloc.Y + (alloc.Height - image.Height) * Yalign);
ctx.Save ();
- ctx.Scale (IconScale, IconScale);
- ctx.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x / IconScale, y / IconScale);
+ ctx.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x, y);
ctx.Restore ();
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs
index 98669371fa..eed709a2ae 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs
@@ -150,12 +150,7 @@ namespace MonoDevelop.Components
private void BuildWidget ()
{
- var yscale = 0f;
-
- if (Platform.IsWindows)
- yscale = (float)GtkWorkarounds.GetScaleFactor (this);
-
- alignment = new Alignment (0.5f, 0.5f, 1f, yscale);
+ alignment = new Alignment (0.5f, 0.5f, 1f, 0f);
alignment.SetPadding (1, 1, 3, 3);
VisibleWindow = false;
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 60370b13db..f48c95b7d1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
@@ -65,7 +65,13 @@ namespace MonoDevelop.Components.Windows
WidgetFlags |= WidgetFlags.NoWindow;
}
- void RepositionWpfWindow ()
+ protected virtual void RepositionWpfWindow ()
+ {
+ int scale = (int)MonoDevelop.Components.GtkWorkarounds.GetScaleFactor(this);
+ RepositionWpfWindow (scale, scale);
+ }
+
+ protected void RepositionWpfWindow (int hscale, int vscale)
{
int x, y;
if (TranslateCoordinates (Toplevel, 0, 0, out x, out y)) {
@@ -75,8 +81,8 @@ namespace MonoDevelop.Components.Windows
wpfWidgetHost.Left = Allocation.Left;
wpfWidgetHost.Top = Allocation.Top;
}
- wpfWidgetHost.Width = Allocation.Width + 1;
- wpfWidgetHost.Height = Allocation.Height + 1;
+ wpfWidgetHost.Width = (Allocation.Width + 1) * hscale;
+ wpfWidgetHost.Height = (Allocation.Height + 1) * vscale;
}
protected override void OnRealized ()
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 a19073f47e..d7b25cf2f8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs
@@ -135,11 +135,10 @@ namespace MonoDevelop.Ide.CodeCompletion
return result;
}
- public virtual Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public virtual void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
var currentWord = GetCurrentWord (window, descriptor);
window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, currentWord, CompletionText);
- return Task.FromResult (ka);
}
public override string ToString ()
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 97026ae2b2..1f4217dae0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs
@@ -35,11 +35,314 @@ using System.Linq;
using MonoDevelop.Ide.Editor.Extension;
using System.ComponentModel;
using System.Threading;
-using System.Threading.Tasks;
-
+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;
@@ -50,6 +353,8 @@ namespace MonoDevelop.Ide.CodeCompletion
int initialWordLength;
int previousWidth = -1, previousHeight = -1;
+ CompletionListWindow facade;
+
public CodeCompletionContext CodeCompletionContext {
get;
set;
@@ -123,22 +428,33 @@ 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 ();
+ VisibilityNotifyEvent += (object sender, VisibilityNotifyEventArgs e) => {
+ if (!Visible)
+ HideDeclarationView ();
+ };
List.ListScrolled += (object sender, EventArgs e) => {
HideDeclarationView ();
UpdateDeclarationView ();
};
List.WordsFiltered += delegate {
- RepositionDeclarationViewWindow ();
+ HideDeclarationView ();
+ UpdateDeclarationView ();
+ };
+ List.VisibilityNotifyEvent += (object sender, VisibilityNotifyEventArgs e) => {
+ if (!List.Visible)
+ HideDeclarationView ();
};
}
@@ -192,13 +508,13 @@ namespace MonoDevelop.Ide.CodeCompletion
base.OnDestroyed ();
}
- public async Task PostProcessKeyEvent (KeyDescriptor descriptor)
+ public void PostProcessKeyEvent (KeyDescriptor descriptor)
{
KeyActions ka = KeyActions.None;
bool keyHandled = false;
if (CompletionDataList != null) {
foreach (var handler in CompletionDataList.KeyHandler) {
- if (handler.PostProcessKey (this, descriptor, out ka)) {
+ if (handler.PostProcessKey (facade, descriptor, out ka)) {
keyHandled = true;
break;
}
@@ -207,10 +523,8 @@ namespace MonoDevelop.Ide.CodeCompletion
if (!keyHandled)
ka = PostProcessKey (descriptor);
- if ((ka & KeyActions.Complete) != 0) {
- var res = await CompleteWord (ka, descriptor);
- ka = res.Item1;
- }
+ if ((ka & KeyActions.Complete) != 0)
+ CompleteWord (ref ka, descriptor);
if ((ka & KeyActions.CloseWindow) != 0) {
CompletionWindowManager.HideWindow ();
OnWindowClosed (EventArgs.Empty);
@@ -238,7 +552,7 @@ namespace MonoDevelop.Ide.CodeCompletion
List.QueueDraw ();
}
- public async Task<bool> PreProcessKeyEvent (KeyDescriptor descriptor)
+ public bool PreProcessKeyEvent (KeyDescriptor descriptor)
{
if (descriptor.SpecialKey == SpecialKey.Escape) {
CompletionWindowManager.HideWindow ();
@@ -249,7 +563,7 @@ namespace MonoDevelop.Ide.CodeCompletion
bool keyHandled = false;
if (CompletionDataList != null) {
foreach (ICompletionKeyHandler handler in CompletionDataList.KeyHandler) {
- if (handler.PreProcessKey (this, descriptor, out ka)) {
+ if (handler.PreProcessKey (facade, descriptor, out ka)) {
keyHandled = true;
break;
}
@@ -257,10 +571,8 @@ namespace MonoDevelop.Ide.CodeCompletion
}
if (!keyHandled)
ka = PreProcessKey (descriptor);
- if ((ka & KeyActions.Complete) != 0) {
- var res = await CompleteWord (ka, descriptor);
- ka = res.Item1;
- }
+ if ((ka & KeyActions.Complete) != 0)
+ CompleteWord (ref ka, descriptor);
if ((ka & KeyActions.CloseWindow) != 0) {
CompletionWindowManager.HideWindow ();
@@ -485,35 +797,35 @@ namespace MonoDevelop.Ide.CodeCompletion
Reposition (true);
}
- public async Task<bool> CompleteWord ()
+ public bool CompleteWord ()
{
- var res = await CompleteWord (KeyActions.None, KeyDescriptor.Empty);
- return res.Item2;
+ KeyActions ka = KeyActions.None;
+ return CompleteWord (ref ka, KeyDescriptor.Empty);
}
internal bool IsInCompletion { get; set; }
- public async Task<Tuple<KeyActions, bool>> CompleteWord (KeyActions ka, KeyDescriptor descriptor)
+ public bool CompleteWord (ref KeyActions ka, KeyDescriptor descriptor)
{
if (SelectedItem == -1 || completionDataList == null)
- return Tuple.Create (ka, false);
+ return false;
var item = completionDataList [SelectedItem];
if (item == null)
- return Tuple.Create (ka, false);
+ return false;
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
+ 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) {
- ka = await item.OverloadedData[declarationviewwindow.CurrentOverload].InsertCompletionText (this, ka, descriptor);
+ item.OverloadedData[declarationviewwindow.CurrentOverload].InsertCompletionText (facade, ref ka, descriptor);
} else {
- ka = await item.InsertCompletionText (this, ka, descriptor);
+ item.InsertCompletionText (facade, ref ka, descriptor);
}
cache.CommitCompletionData (item);
OnWordCompleted (new CodeCompletionContextEventArgs (CompletionWidget, CodeCompletionContext, item.DisplayText));
@@ -521,7 +833,7 @@ namespace MonoDevelop.Ide.CodeCompletion
IsInCompletion = false;
CompletionWindowManager.HideWindow ();
}
- return Tuple.Create (ka, true);
+ return true;
}
protected virtual void OnWordCompleted (CodeCompletionContextEventArgs e)
@@ -644,8 +956,15 @@ 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 (0, Math.Min (Allocation.Height, Math.Max (0, y)), Allocation.Width, rect.Height), PopupPosition.Left);
- declarationViewHidden = false;
+ if (!declarationViewHidden && Visible && List.Visible && completionDataList != null &&
+ List.SelectionFilterIndex < completionDataList.Count && List.SelectionFilterIndex != -1)
+ declarationviewwindow.ShowPopup (
+ this,
+ new Gdk.Rectangle (0, Math.Min (Allocation.Height, Math.Max (0, y)), Allocation.Width, rect.Height),
+ PopupPosition.Left);
+ if (declarationViewHidden || !Visible || !List.Visible || completionDataList == null ||
+ List.SelectionFilterIndex >= completionDataList.Count || List.SelectionFilterIndex == -1)
+ HideDeclarationView();
}
bool DelayedTooltipShow ()
@@ -706,6 +1025,7 @@ namespace MonoDevelop.Ide.CodeCompletion
}
if (declarationViewHidden && Visible) {
+ declarationViewHidden = false;
RepositionDeclarationViewWindow ();
}
@@ -722,63 +1042,63 @@ namespace MonoDevelop.Ide.CodeCompletion
#region IListDataProvider
- int IListDataProvider.ItemCount
+ internal int ItemCount
{
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 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];
return completionData.GetDisplayTextMarkup ();
}
- string IListDataProvider.GetCompletionText (int n)
+ internal string GetCompletionText (int n)
{
return ((CompletionData)completionDataList[n]).CompletionText;
}
- CompletionData IListDataProvider.GetCompletionData (int n)
+ internal CompletionData GetCompletionData (int n)
{
return completionDataList[n];
}
IComparer<CompletionData> defaultComparer;
- int IListDataProvider.CompareTo (int n, int m)
+ 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))
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 d9cd9667ba..b693a28e9f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs
@@ -28,8 +28,7 @@ using System;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Editor.Extension;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.Ide.CodeCompletion
{
public class CompletionWindowManager
@@ -130,7 +129,6 @@ namespace MonoDevelop.Ide.CodeCompletion
if (IdeApp.Preferences.ForceSuggestionMode)
wnd.AutoSelect = false;
wnd.Show ();
- DesktopService.RemoveWindowShadow (wnd);
OnWindowShown (EventArgs.Empty);
return true;
} catch (Exception ex) {
@@ -159,10 +157,10 @@ namespace MonoDevelop.Ide.CodeCompletion
OnWindowClosed (EventArgs.Empty);
}
- public static Task<bool> PreProcessKeyEvent (KeyDescriptor descriptor)
+ public static bool PreProcessKeyEvent (KeyDescriptor descriptor)
{
if (!IsVisible)
- return Task.FromResult (false);
+ return false;
if (descriptor.KeyChar != '\0') {
wnd.EndOffset = wnd.StartOffset + wnd.CurrentPartialWord.Length + 1;
}
@@ -184,16 +182,16 @@ namespace MonoDevelop.Ide.CodeCompletion
public static void UpdateWordSelection (string text)
{
if (IsVisible) {
- wnd.List.CompletionString = text;
+ wnd.CompletionString = text;
wnd.UpdateWordSelection ();
}
}
- public static Task PostProcessKeyEvent (KeyDescriptor descriptor)
+ public static void PostProcessKeyEvent (KeyDescriptor descriptor)
{
if (!IsVisible)
- return TaskUtil.Default<object> ();
- return wnd.PostProcessKeyEvent (descriptor);
+ return;
+ wnd.PostProcessKeyEvent (descriptor);
}
public static void RepositionWindow ()
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 53d756e2ad..54da3bad1f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs
@@ -43,7 +43,7 @@ using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.CodeCompletion
{
- public class ListWidget : Gtk.DrawingArea
+ class ListWidget : Gtk.DrawingArea
{
int listWidth = minSize;
const int minSize = 400;
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 dfd9a1927f..20d26fdb51 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs
@@ -49,7 +49,7 @@ namespace MonoDevelop.Ide.CodeCompletion
Complete = 8
}
- public class ListWindow : PopoverWindow
+ class ListWindow : PopoverWindow
{
const int WindowWidth = 400;
@@ -105,11 +105,11 @@ namespace MonoDevelop.Ide.CodeCompletion
Theme.Padding = 0;
UpdateStyle ();
- Gui.Styles.Changed += HandleSkinChanged;
- IdeApp.Preferences.ColorScheme.Changed += HandleSkinChanged;
+ Gui.Styles.Changed += HandleThemeChanged;
+ IdeApp.Preferences.ColorScheme.Changed += HandleThemeChanged;
}
- void HandleSkinChanged (object sender, EventArgs e)
+ void HandleThemeChanged (object sender, EventArgs e)
{
UpdateStyle ();
}
@@ -125,8 +125,8 @@ namespace MonoDevelop.Ide.CodeCompletion
protected override void OnDestroyed ()
{
base.OnDestroyed ();
- Gui.Styles.Changed -= HandleSkinChanged;
- IdeApp.Preferences.ColorScheme.Changed -= HandleSkinChanged;
+ Gui.Styles.Changed -= HandleThemeChanged;
+ IdeApp.Preferences.ColorScheme.Changed -= HandleThemeChanged;
}
protected virtual void DoubleClick ()
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 9a042f0066..fd5fbfd6de 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs
@@ -97,8 +97,8 @@ namespace MonoDevelop.Ide.CodeCompletion
ContentBox.Add (vb2);
UpdateStyle ();
- Styles.Changed += HandleSkinChanged;
- IdeApp.Preferences.ColorScheme.Changed += HandleSkinChanged;
+ Styles.Changed += HandleThemeChanged;
+ IdeApp.Preferences.ColorScheme.Changed += HandleThemeChanged;
ShowAll ();
DesktopService.RemoveWindowShadow (this);
@@ -107,8 +107,8 @@ namespace MonoDevelop.Ide.CodeCompletion
void UpdateStyle ()
{
var scheme = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
- if (!scheme.FitsIdeSkin (IdeApp.Preferences.UserInterfaceSkin))
- scheme = SyntaxModeService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceSkin);
+ if (!scheme.FitsIdeTheme (IdeApp.Preferences.UserInterfaceTheme))
+ scheme = SyntaxModeService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceTheme);
Theme.SetSchemeColors (scheme);
Theme.Font = FontService.SansFont.CopyModified (Styles.FontScale11);
@@ -122,7 +122,7 @@ namespace MonoDevelop.Ide.CodeCompletion
QueueDraw ();
}
- void HandleSkinChanged (object sender, EventArgs e)
+ void HandleThemeChanged (object sender, EventArgs e)
{
UpdateStyle ();
}
@@ -130,8 +130,8 @@ namespace MonoDevelop.Ide.CodeCompletion
protected override void OnDestroyed ()
{
base.OnDestroyed ();
- Styles.Changed -= HandleSkinChanged;
- IdeApp.Preferences.ColorScheme.Changed -= HandleSkinChanged;
+ Styles.Changed -= HandleThemeChanged;
+ IdeApp.Preferences.ColorScheme.Changed -= HandleThemeChanged;
}
int lastParam = -2;
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 b5aebce226..3949b5b5a6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs
@@ -289,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;
}
}
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 0891cae652..9db0f75515 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs
@@ -257,8 +257,8 @@ namespace MonoDevelop.Ide.CodeCompletion
internal void SetDefaultScheme ()
{
var scheme = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
- if (!scheme.FitsIdeSkin (IdeApp.Preferences.UserInterfaceSkin))
- scheme = SyntaxModeService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceSkin);
+ if (!scheme.FitsIdeTheme (IdeApp.Preferences.UserInterfaceTheme))
+ scheme = SyntaxModeService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceTheme);
Theme.SetSchemeColors (scheme);
foreColor = Styles.PopoverWindow.DefaultTextColor.ToCairoColor ();
@@ -304,8 +304,8 @@ namespace MonoDevelop.Ide.CodeCompletion
vb2.ShowAll ();
SetDefaultScheme ();
- Styles.Changed += HandleSkinChanged;
- IdeApp.Preferences.ColorScheme.Changed += HandleSkinChanged;
+ Styles.Changed += HandleThemeChanged;
+ IdeApp.Preferences.ColorScheme.Changed += HandleThemeChanged;
}
public override void RepositionWindow(Gdk.Rectangle? newCaret = null)
@@ -331,7 +331,7 @@ namespace MonoDevelop.Ide.CodeCompletion
base.OnPagerRightClicked ();
}
- void HandleSkinChanged (object sender, EventArgs e)
+ void HandleThemeChanged (object sender, EventArgs e)
{
SetDefaultScheme ();
}
@@ -339,8 +339,8 @@ namespace MonoDevelop.Ide.CodeCompletion
protected override void OnDestroyed ()
{
base.OnDestroyed ();
- Styles.Changed -= HandleSkinChanged;
- IdeApp.Preferences.ColorScheme.Changed -= HandleSkinChanged;
+ Styles.Changed -= HandleThemeChanged;
+ IdeApp.Preferences.ColorScheme.Changed -= HandleThemeChanged;
}
}
}
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 2348949c41..f3c254cc0c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs
@@ -30,8 +30,7 @@ using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Core;
using MonoDevelop.Ide.Editor.Extension;
using MonoDevelop.Ide.Editor;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.Ide.CodeTemplates
{
public interface ICodeTemplateHandler
@@ -54,10 +53,9 @@ namespace MonoDevelop.Ide.CodeTemplates
this.Description = template.Shortcut + Environment.NewLine + GettextCatalog.GetString (template.Description);
}
- public override Task<KeyActions> InsertCompletionText (CompletionListWindow window, KeyActions ka, KeyDescriptor descriptor)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
- template.Insert (doc.Editor, doc.DocumentContext);
- return Task.FromResult (ka);
+ template.Insert (doc.Editor, doc.DocumentContext);
}
}
}
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 2a6cf53298..db454bff9e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs
@@ -149,31 +149,33 @@ namespace MonoDevelop.Ide.CodeTemplates
CodeTemplateService.Templates = templates;
}
- void RenderIcon (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ static void RenderIcon (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
- CodeTemplate template = (CodeTemplate)templateStore.GetValue (iter, 0);
-
+ CodeTemplate template = (CodeTemplate)model.GetValue (iter, 0);
+
+ var cri = (CellRendererImage)cell;
if (template == null) {
- pixbufCellRenderer.Image = ImageService.GetIcon (treeviewCodeTemplates.GetRowExpanded (templateStore.GetPath (iter)) ? MonoDevelop.Ide.Gui.Stock.OpenFolder : MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
+ cri.Image = ImageService.GetIcon (((TreeView)column.TreeView).GetRowExpanded (model.GetPath (iter)) ? MonoDevelop.Ide.Gui.Stock.OpenFolder : MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
} else {
- pixbufCellRenderer.Image = ImageService.GetIcon (template.Icon, IconSize.Menu);
+ cri.Image = ImageService.GetIcon (template.Icon, IconSize.Menu);
}
}
void RenderTemplateName (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
- CodeTemplate template = (CodeTemplate)templateStore.GetValue (iter, 0);
+ CodeTemplate template = (CodeTemplate)model.GetValue (iter, 0);
+ var crt = (CellRendererText)cell;
if (template == null) {
- templateCellRenderer.Markup = (string)templateStore.GetValue (iter, 2);
+ crt.Markup = (string)model.GetValue (iter, 2);
return;
}
- if (treeviewCodeTemplates.Selection.IterIsSelected (iter)) {
- templateCellRenderer.Markup = GLib.Markup.EscapeText (template.Shortcut) + " (" +
+ if (((TreeView)column.TreeView).Selection.IterIsSelected (iter)) {
+ crt.Markup = GLib.Markup.EscapeText (template.Shortcut) + " (" +
GLib.Markup.EscapeText (GettextCatalog.GetString (template.Description)) + ")";
} else {
- templateCellRenderer.Markup = GLib.Markup.EscapeText (template.Shortcut) + " <span foreground=\"" +
+ crt.Markup = GLib.Markup.EscapeText (template.Shortcut) + " <span foreground=\"" +
GetColorString (Style.Text (StateType.Insensitive)) + "\">("
+ GLib.Markup.EscapeText (GettextCatalog.GetString (template.Description)) + ")</span>";
}
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 15608d9ec5..66a3d52aef 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs
@@ -88,13 +88,12 @@ namespace MonoDevelop.Ide.Codons
{
if (content == null) {
content = CreatePad ();
+ }
+ if (!initializeCalled) {
content.Init (window);
ApplyPreferences ();
- } else if (!initializeCalled) {
- content.Init (window);
- ApplyPreferences ();
+ initializeCalled = true;
}
- initializeCalled = true;
return content;
}
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 103f572e76..22211b010e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
@@ -376,6 +376,7 @@ namespace MonoDevelop.Ide.Commands
{
object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null;
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;
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 a2f3db5129..44fce11e2d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs
@@ -40,6 +40,7 @@ using System.Threading;
using System.Xml;
using System.Linq;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Desktop
{
@@ -55,7 +56,8 @@ namespace MonoDevelop.Ide.Desktop
string filePath;
FileSystemWatcher watcher;
- List<RecentItem> cachedItemList;
+ object cacheLock = new object ();
+ List<RecentItem> cachedItemList = new List<RecentItem> ();
public static string DefaultPath {
get {
@@ -66,6 +68,25 @@ namespace MonoDevelop.Ide.Desktop
public RecentFileStorage (string filePath)
{
this.filePath = filePath;
+
+ // Kick off loading the recent item store in the background in the background.
+ AcquireFileExclusive (filePath).ContinueWith (t => {
+ if (t.IsFaulted) {
+ Exception ex = t.Exception;
+ while (ex is AggregateException && ex.InnerException != null) {
+ ex = ex.InnerException;
+ }
+
+ LoggingService.LogError ("Failed to acquire recent items lock", t.Exception);
+ return;
+ }
+
+ var stream = t.Result;
+ lock (cacheLock) {
+ cachedItemList = ReadStore (stream);
+ cachedItemList.Sort ();
+ }
+ });
}
void EnableWatching ()
@@ -98,12 +119,12 @@ namespace MonoDevelop.Ide.Desktop
void FileChanged (object sender, FileSystemEventArgs e)
{
- OnRecentFilesChanged (null);
+ OnRecentFilesChanged (cachedItemList);
}
void HandleWatcherRenamed (object sender, RenamedEventArgs e)
{
- OnRecentFilesChanged (null);
+ OnRecentFilesChanged (cachedItemList);
}
public bool RemoveItem (string uri)
@@ -144,15 +165,10 @@ namespace MonoDevelop.Ide.Desktop
if (!File.Exists (filePath)) {
return new RecentItem[0];
}
-
- var c = cachedItemList;
- if (c == null) {
- using (var fs = AcquireFileExclusive (filePath)) {
- c = cachedItemList = ReadStore (fs);
- }
+
+ lock (cacheLock) {
+ return cachedItemList.Where (item => item.IsInGroup (group)).ToArray ();
}
- c.Sort ();
- return c.Where (item => item.IsInGroup (group)).ToArray ();
}
public void RemoveMissingFiles (params string[] groups)
@@ -191,6 +207,7 @@ namespace MonoDevelop.Ide.Desktop
if (list[i].IsInGroup (group) && (++count > limit)) {
list.RemoveAt (i);
i--;
+ modified = true;
}
}
return modified;
@@ -207,22 +224,59 @@ namespace MonoDevelop.Ide.Desktop
}
return modified;
}
-
+
+ Task recentSaveTask;
+ List<Func<List<RecentItem>, bool>> modifyList = new List<Func<List<RecentItem>, bool>> ();
+ object modifyListLock = new object ();
bool ModifyStore (Func<List<RecentItem>,bool> modify)
{
- List<RecentItem> list;
- using (var fs = AcquireFileExclusive (filePath)) {
- list = ReadStore (fs);
- if (!modify (list)) {
- return false;
+ lock (modifyListLock) {
+ modifyList.Add (modify);
+
+ // This makes recent file changed event to happen as late as possible, but it shouldn't be a problem.
+ // We keep both multiple-instance concurrency via AcquireFileExclusive lock
+ // And we batch as many modifications as possible in a 1 second window.
+ if (recentSaveTask == null) {
+ recentSaveTask = Task.Run (async () => {
+ await Task.Delay (1000);
+ await SaveRecentFiles ();
+ });
+ }
+ }
+ lock (cacheLock) {
+ return modify (cachedItemList);
+ }
+ }
+
+ async Task SaveRecentFiles ()
+ {
+ List<Func<List<RecentItem>, bool>> localModifyList;
+
+ lock (modifyListLock) {
+ localModifyList = modifyList;
+ modifyList = new List<Func<List<RecentItem>, bool>> ();
+ recentSaveTask = null;
+ }
+
+ using (var fs = await AcquireFileExclusive (filePath)) {
+ var list = ReadStore (fs);
+ bool modified = false;
+
+ foreach (var modify in localModifyList) {
+ if (!modify (list)) {
+ continue;
+ }
+
+ modified = true;
+ }
+
+ if (modified) {
+ fs.Position = 0;
+ fs.SetLength (0);
+ WriteStore (fs, list);
+ OnRecentFilesChanged (list);
}
- fs.Position = 0;
- fs.SetLength (0);
- WriteStore (fs, list);
}
- //TODO: can we suppress duplicate event from the FSW?
- OnRecentFilesChanged (list);
- return true;
}
static List<RecentItem> ReadStore (FileStream file)
@@ -266,7 +320,7 @@ namespace MonoDevelop.Ide.Desktop
}
//FIXME: should we P/Invoke lockf on POSIX or is Mono's FileShare.None sufficient?
- static FileStream AcquireFileExclusive (string filePath)
+ static async Task<FileStream> AcquireFileExclusive (string filePath)
{
const int MAX_WAIT_TIME = 1000;
const int RETRY_WAIT = 50;
@@ -279,7 +333,7 @@ namespace MonoDevelop.Ide.Desktop
} catch (Exception ex) {
//FIXME: will it work on Mono if we check that it's an access conflict, i.e. HResult is 0x80070020?
if (ex is IOException && remainingTries > 0) {
- Thread.Sleep (RETRY_WAIT);
+ await Task.Delay (RETRY_WAIT);
remainingTries--;
continue;
}
@@ -293,9 +347,12 @@ namespace MonoDevelop.Ide.Desktop
return fileName.StartsWith ("file://") ? fileName : "file://" + fileName;
}
- void OnRecentFilesChanged (List<RecentItem> cachedItemList)
+ void OnRecentFilesChanged (List<RecentItem> list)
{
- this.cachedItemList = cachedItemList;
+ lock (cacheLock) {
+ cachedItemList = list;
+ }
+
Runtime.RunInMainThread (() => {
if (changed != null)
changed (this, EventArgs.Empty);
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 7675e92b7c..939b9dcd10 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs
@@ -118,37 +118,31 @@ namespace MonoDevelop.Ide.Desktop
void Add (string grp, string fileName, string displayName)
{
var mime = DesktopService.GetMimeTypeForUri (fileName);
- System.Threading.ThreadPool.QueueUserWorkItem (_ => {
- try {
- var uri = RecentFileStorage.ToUri (fileName);
- var recentItem = new RecentItem (uri, mime, grp) { Private = displayName };
- recentFiles.AddWithLimit (recentItem, grp, ItemLimit);
- } catch (Exception e) {
- LoggingService.LogError ("Failed to add item to recent files list.", e);
- }
- });
+ try {
+ var uri = RecentFileStorage.ToUri (fileName);
+ var recentItem = new RecentItem (uri, mime, grp) { Private = displayName };
+ recentFiles.AddWithLimit (recentItem, grp, ItemLimit);
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to add item to recent files list.", e);
+ }
}
public override void NotifyFileRemoved (string fileName)
{
- System.Threading.ThreadPool.QueueUserWorkItem (_ => {
- try {
- recentFiles.RemoveItem (RecentFileStorage.ToUri (fileName));
- } catch (Exception e) {
- LoggingService.LogError ("Can't remove from recent files list.", e);
- }
- });
+ try {
+ recentFiles.RemoveItem (RecentFileStorage.ToUri (fileName));
+ } catch (Exception e) {
+ LoggingService.LogError ("Can't remove from recent files list.", e);
+ }
}
public override void NotifyFileRenamed (string oldName, string newName)
{
- System.Threading.ThreadPool.QueueUserWorkItem (_ => {
- try {
- recentFiles.RenameItem (RecentFileStorage.ToUri (oldName), RecentFileStorage.ToUri (newName));
- } catch (Exception e) {
- LoggingService.LogError ("Can't rename file in recent files list.", e);
- }
- });
+ try {
+ recentFiles.RenameItem (RecentFileStorage.ToUri (oldName), RecentFileStorage.ToUri (newName));
+ } catch (Exception e) {
+ LoggingService.LogError ("Can't rename file in recent files list.", e);
+ }
}
public void Dispose ()
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
index 0b2291200a..96181de06f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AutoInsertBracketTextEditorExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AutoInsertBracketTextEditorExtension.cs
@@ -26,7 +26,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Threading.Tasks;
using Mono.Addins;
namespace MonoDevelop.Ide.Editor.Extension
@@ -57,9 +56,9 @@ namespace MonoDevelop.Ide.Editor.Extension
});
}
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
- var result = await base.KeyPress (descriptor);
+ var result = base.KeyPress (descriptor);
if (DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket && !Editor.IsSomethingSelected) {
var handler = allHandlers.FirstOrDefault(h => h.CanHandle (Editor));
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
index a372c6386c..456cc91f4e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatcherTextEditorExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatcherTextEditorExtension.cs
@@ -65,6 +65,7 @@ namespace MonoDevelop.Ide.Editor.Extension
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)
@@ -89,6 +90,7 @@ namespace MonoDevelop.Ide.Editor.Extension
public override void Dispose ()
{
src.Cancel ();
+ DefaultSourceEditorOptions.Instance.highlightMatchingBracket.Changed -= HighlightMatchingBracket_Changed;
if (isSubscribed) {
Editor.CaretPositionChanged -= Editor_CaretPositionChanged;
DocumentContext.DocumentParsed -= HandleDocumentParsed;
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
index 2bc04531f2..5d90308e68 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs
@@ -93,12 +93,12 @@ namespace MonoDevelop.Ide.Editor.Extension
// 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 async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
bool res;
if (CurrentCompletionContext != null) {
- if (await CompletionWindowManager.PreProcessKeyEvent (descriptor)) {
- await CompletionWindowManager.PostProcessKeyEvent (descriptor);
+ if (CompletionWindowManager.PreProcessKeyEvent (descriptor)) {
+ CompletionWindowManager.PostProcessKeyEvent (descriptor);
autoHideCompletionWindow = true;
// in named parameter case leave the parameter window open.
autoHideParameterWindow = descriptor.KeyChar != ':';
@@ -124,9 +124,9 @@ namespace MonoDevelop.Ide.Editor.Extension
if (descriptor.SpecialKey == SpecialKey.BackSpace && Editor.CaretOffset > 0)
deleteOrBackspaceTriggerChar = Editor.GetCharAt (Editor.CaretOffset - 1);
- res = await base.KeyPress (descriptor);
+ res = base.KeyPress (descriptor);
- await CompletionWindowManager.PostProcessKeyEvent (descriptor);
+ CompletionWindowManager.PostProcessKeyEvent (descriptor);
var ignoreMods = ModifierKeys.Control | ModifierKeys.Alt
| ModifierKeys.Command;
@@ -158,26 +158,28 @@ namespace MonoDevelop.Ide.Editor.Extension
completionTokenSrc.Cancel ();
};
CompletionWindowManager.WindowClosed += windowClosed;
-
- var result = await task;
- CompletionWindowManager.WindowClosed -= windowClosed;
- if (!token.IsCancellationRequested) {
+
+ 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))) {
+ 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.
+ }
+ // Now show the window for real.
if (!CompletionWindowManager.ShowWindow (result, CurrentCompletionContext))
CurrentCompletionContext = null;
} else {
CompletionWindowManager.HideWindow ();
CurrentCompletionContext = null;
}
- }
+ }, Runtime.MainTaskScheduler);
} else {
CurrentCompletionContext = null;
}
@@ -214,9 +216,11 @@ namespace MonoDevelop.Ide.Editor.Extension
};
CompletionWindowManager.WindowClosed += windowClosed;
- var result = await task;
- CompletionWindowManager.WindowClosed -= windowClosed;
- if (!token.IsCancellationRequested) {
+ task.ContinueWith (t => {
+ CompletionWindowManager.WindowClosed -= windowClosed;
+ if (token.IsCancellationRequested)
+ return;
+ var result = t.Result;
if (result != null) {
int triggerWordLength = result.TriggerWordLength + (Editor.CaretOffset - caretOffset);
@@ -236,7 +240,7 @@ namespace MonoDevelop.Ide.Editor.Extension
CompletionWindowManager.HideWindow ();
CurrentCompletionContext = null;
}
- }
+ }, Runtime.MainTaskScheduler);
} else {
CurrentCompletionContext = null;
}
@@ -255,9 +259,10 @@ namespace MonoDevelop.Ide.Editor.Extension
try {
var task = HandleParameterCompletionAsync (ctx, descriptor.KeyChar, token);
if (task != null) {
- var result = await task;
- if (!token.IsCancellationRequested && result != null)
- ParameterInformationWindowManager.ShowWindow (this, CompletionWidget, ctx, result);
+ task.ContinueWith (t => {
+ if (!token.IsCancellationRequested && t.Result != null)
+ ParameterInformationWindowManager.ShowWindow (this, CompletionWidget, ctx, t.Result);
+ }, Runtime.MainTaskScheduler);
}
} catch (TaskCanceledException) {
} catch (AggregateException) {
@@ -363,11 +368,7 @@ namespace MonoDevelop.Ide.Editor.Extension
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;
+ var wnd = CompletionListWindow.CreateAsDialog ();
wnd.Extension = this;
wnd.ShowListWindow ((char)0, completionList, CompletionWidget, ctx);
}
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
index 9632185c24..1d4e5b77ef 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs
@@ -141,7 +141,7 @@ namespace MonoDevelop.Ide.Editor.Extension
async Task UpdateErrorUndelines (DocumentContext ctx, ParsedDocument parsedDocument, CancellationToken token)
{
- if (!DefaultSourceEditorOptions.Instance.UnderlineErrors || parsedDocument == null || isDisposed)
+ if (parsedDocument == null || isDisposed)
return;
try {
var errors = await parsedDocument.GetErrorsAsync(token).ConfigureAwait (false);
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
index 272888894e..a6b4cf594c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs
@@ -32,8 +32,7 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.TypeSystem;
using System.Collections;
using System.Collections.Generic;
-using System.Threading.Tasks;
-
+
namespace MonoDevelop.Ide.Editor.Extension
{
public abstract class TextEditorExtension : ICommandRouter, IDisposable
@@ -79,9 +78,9 @@ namespace MonoDevelop.Ide.Editor.Extension
/// 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 async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public virtual bool KeyPress (KeyDescriptor descriptor)
{
- return Next == null || await Next.KeyPress (descriptor);
+ return Next == null || Next.KeyPress (descriptor);
}
public virtual void Dispose ()
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
index d0392f96a8..1bd4d60191 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SyntaxModeService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SyntaxModeService.cs
@@ -66,37 +66,37 @@ namespace MonoDevelop.Ide.Editor.Highlighting
}
}
- public static ColorScheme GetDefaultColorStyle (this Skin skin)
+ public static ColorScheme GetDefaultColorStyle (this Theme theme)
{
- return GetColorStyle (GetDefaultColorStyleName (skin));
+ return GetColorStyle (GetDefaultColorStyleName (theme));
}
public static string GetDefaultColorStyleName ()
{
- return GetDefaultColorStyleName (IdeApp.Preferences.UserInterfaceSkin);
+ return GetDefaultColorStyleName (IdeApp.Preferences.UserInterfaceTheme);
}
- public static string GetDefaultColorStyleName (this Skin skin)
+ public static string GetDefaultColorStyleName (this Theme theme)
{
- switch (skin) {
- case Skin.Light:
+ switch (theme) {
+ case Theme.Light:
return IdePreferences.DefaultLightColorScheme;
- case Skin.Dark:
+ case Theme.Dark:
return IdePreferences.DefaultDarkColorScheme;
default:
throw new InvalidOperationException ();
}
}
- public static ColorScheme GetUserColorStyle (this Skin skin)
+ public static ColorScheme GetUserColorStyle (this Theme theme)
{
- var schemeName = IdeApp.Preferences.ColorScheme.ValueForSkin (skin);
+ var schemeName = IdeApp.Preferences.ColorScheme.ValueForTheme (theme);
return GetColorStyle (schemeName);
}
- public static bool FitsIdeSkin (this ColorScheme scheme, Skin skin)
+ public static bool FitsIdeTheme (this ColorScheme scheme, Theme theme)
{
- if (skin == Skin.Dark)
+ if (theme == Theme.Dark)
return (scheme.PlainText.Background.L <= 0.5);
return (scheme.PlainText.Background.L > 0.5);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs
index fa316c9f49..26202b4ceb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs
@@ -359,17 +359,6 @@ namespace MonoDevelop.Ide.Editor
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 {
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
index 73e807a2be..741fabe3c2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedCompletionExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedCompletionExtension.cs
@@ -319,16 +319,16 @@ namespace MonoDevelop.Ide.Editor.Projection
return projectedExtension.HandleParameterCompletionAsync (ConvertContext (completionContext), completionChar, token);
}
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
var task = ctx.GetPartialProjectionsAsync ();
if (task != null)
- projections = await task;
+ projections = task.Result;
var projectedExtension = GetCurrentExtension();
if (projectedExtension != null) {
- return await projectedExtension.KeyPress (descriptor);
+ return projectedExtension.KeyPress (descriptor);
}
- return await base.KeyPress (descriptor);
+ return base.KeyPress (descriptor);
}
public override Task<ParameterHintingResult> ParameterCompletionCommand (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext)
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
index 4560596b85..8174b221ce 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedFilterCompletionTextEditorExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedFilterCompletionTextEditorExtension.cs
@@ -67,11 +67,11 @@ namespace MonoDevelop.Ide.Editor.Projection
return false;
}
- public override async Task<bool> KeyPress (KeyDescriptor descriptor)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
if (!IsActiveExtension())
- return Next == null || await Next.KeyPress (descriptor);
- return await completionTextEditorExtension.KeyPress (descriptor);
+ return Next == null || Next.KeyPress (descriptor);
+ return completionTextEditorExtension.KeyPress (descriptor);
}
public override bool IsValidInContext (DocumentContext context)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
index 7e3d633814..4fa307c305 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
@@ -743,8 +743,10 @@ namespace MonoDevelop.Ide.Editor
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);
+ if (offset < 0 || offset > Length)
+ throw new ArgumentOutOfRangeException (nameof (offset), "offset needs to be >= 0 && <= " + Length + ", was :" + offset);
+ if (offset + length > Length)
+ throw new ArgumentOutOfRangeException (nameof (Length), "Length needs to <= " + (Length - offset) + ", was :" + length);
return ReadOnlyTextDocument.GetTextAt (offset, length);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
index 82e0592c1e..c8e52d6540 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
@@ -72,6 +72,19 @@ namespace MonoDevelop.Ide.Editor
this.textEditorImpl = textEditorImpl;
this.textEditor.MimeTypeChanged += UpdateTextEditorOptions;
DefaultSourceEditorOptions.Instance.Changed += UpdateTextEditorOptions;
+ textEditorImpl.ViewContent.ContentNameChanged += ViewContent_ContentNameChanged;
+ textEditorImpl.ViewContent.DirtyChanged += ViewContent_DirtyChanged; ;
+
+ }
+
+ void ViewContent_ContentNameChanged (object sender, EventArgs e)
+ {
+ this.ContentName = textEditorImpl.ViewContent.ContentName;
+ }
+
+ void ViewContent_DirtyChanged (object sender, EventArgs e)
+ {
+ OnDirtyChanged ();
}
void HandleDirtyChanged (object sender, EventArgs e)
@@ -181,13 +194,6 @@ namespace MonoDevelop.Ide.Editor
}
}
- protected override void OnContentNameChanged ()
- {
- base.OnContentNameChanged ();
- textEditorImpl.ContentName = ContentName;
- }
-
-
#region IViewFContent implementation
public override async Task Load (FileOpenInformation fileOpenInformation)
@@ -290,6 +296,14 @@ namespace MonoDevelop.Ide.Editor
}
}
+ public override bool IsDirty {
+ get { return textEditorImpl.ViewContent.IsDirty; }
+ set {
+ textEditorImpl.ViewContent.IsDirty = value;
+ }
+ }
+
+
#endregion
#region IDisposable implementation
@@ -307,6 +321,8 @@ namespace MonoDevelop.Ide.Editor
textEditorImpl.ViewContent.DirtyChanged -= HandleDirtyChanged;
textEditor.MimeTypeChanged -= UpdateTextEditorOptions;
textEditor.TextChanged -= HandleTextChanged;
+ textEditorImpl.ViewContent.ContentNameChanged -= ViewContent_ContentNameChanged;
+ textEditorImpl.ViewContent.DirtyChanged -= ViewContent_DirtyChanged; ;
DefaultSourceEditorOptions.Instance.Changed -= UpdateTextEditorOptions;
RemovePolicyChangeHandler ();
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.FindInFiles/FileProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
index 23698d4a63..a0267de29e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
@@ -76,22 +76,15 @@ namespace MonoDevelop.Ide.FindInFiles
SelectionEndPosition = selectionEndPosition;
}
- public string ReadString ()
+ public TextReader ReadString ()
{
return ReadString (false);
}
- WeakReference cachedText;
-
- public string ReadString (bool readBinaryFiles)
+ public TextReader ReadString (bool readBinaryFiles)
{
- string result = cachedText != null ? cachedText.Target as string : null;
- if (result != null) {
- return result;
- }
-
if (buffer != null) {
- result = buffer.ToString ();
+ return new StringReader (buffer.ToString ());
} else {
Document doc = null;
@@ -100,25 +93,20 @@ namespace MonoDevelop.Ide.FindInFiles
doc = task.Result;
if (doc != null && doc.Editor != null) {
- result = doc.Editor.Text;
- encoding = doc.Editor.Encoding;
- hadBom = doc.Editor.UseBOM;
+ return doc.Editor.CreateReader ();
} else {
try {
if (!File.Exists (FileName))
return null;
- var content = File.ReadAllBytes (FileName);
- if (!readBinaryFiles && TextFileUtility.IsBinary (content))
+ if (!readBinaryFiles && TextFileUtility.IsBinary (FileName))
return null;
- result = TextFileUtility.GetText (content, out encoding, out hadBom);
+ return TextFileUtility.OpenStream (FileName);
} catch (Exception e) {
LoggingService.LogError ("Error while opening " + FileName, e);
return null;
}
}
}
- cachedText = new WeakReference (result);
- return result;
}
async Task<Document> SearchDocument ()
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 cd974b4cdb..e083aaf58f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs
@@ -679,7 +679,14 @@ namespace MonoDevelop.Ide.FindInFiles
}
protected override void OnDestroyed ()
- {
+ {
+ if (resultPad != null) {
+ var resultWidget = resultPad.Control.GetNativeWidget<SearchResultWidget> ();
+ if (resultWidget.ResultCount > 0) {
+ resultPad.Window.Activate (true);
+ }
+ }
+
if (updateTimer != 0) {
GLib.Source.Remove (updateTimer);
updateTimer = 0;
@@ -772,29 +779,35 @@ 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);
}
static CancellationTokenSource searchTokenSource = new CancellationTokenSource ();
static Task currentTask;
uint updateTimer;
+ SearchResultPad resultPad;
void UpdateStopButton ()
{
buttonStop.Sensitive = currentTask != null && !currentTask.IsCompleted;
}
+ void UpdateResultPad (SearchResultPad pad)
+ {
+ resultPad = pad;
+ }
+
void ButtonStopClicked (object sender, EventArgs e)
{
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))
@@ -823,10 +836,16 @@ namespace MonoDevelop.Ide.FindInFiles
searchTokenSource = cancelSource;
var token = cancelSource.Token;
currentTask = Task.Run (delegate {
- using (SearchProgressMonitor searchMonitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, cancellationTokenSource:cancelSource)) {
+ using (SearchProgressMonitor searchMonitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true)) {
searchMonitor.PathMode = scope.PathMode;
+ if (UpdateResultPad != null) {
+ Application.Invoke (delegate {
+ UpdateResultPad (searchMonitor.ResultPad);
+ });
+ }
+
searchMonitor.ReportStatus (scope.GetDescription (options, pattern, null));
if (UpdateStopButton != null) {
Application.Invoke (delegate {
@@ -850,20 +869,18 @@ namespace MonoDevelop.Ide.FindInFiles
LoggingService.LogError ("Error while search", ex);
}
- string message;
+ string message = null;
if (errorMessage != null) {
message = GettextCatalog.GetString ("The search could not be finished: {0}", errorMessage);
searchMonitor.ReportError (message, null);
- } else if (searchMonitor.CancellationToken.IsCancellationRequested) {
- message = GettextCatalog.GetString ("Search cancelled.");
- searchMonitor.ReportWarning (message);
- } else {
+ } else if (!searchMonitor.CancellationToken.IsCancellationRequested) {
string matches = string.Format (GettextCatalog.GetPluralString ("{0} match found", "{0} matches found", find.FoundMatchesCount), find.FoundMatchesCount);
string files = string.Format (GettextCatalog.GetPluralString ("in {0} file.", "in {0} files.", find.SearchedFilesCount), find.SearchedFilesCount);
message = GettextCatalog.GetString ("Search completed.") + Environment.NewLine + matches + " " + files;
searchMonitor.ReportSuccess (message);
}
- searchMonitor.ReportStatus (message);
+ if (message != null)
+ searchMonitor.ReportStatus (message);
searchMonitor.Log.WriteLine (GettextCatalog.GetString ("Search time: {0} seconds."), (DateTime.Now - timer).TotalSeconds);
}
if (UpdateStopButton != null) {
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 aaae54a669..1d94b9bf22 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs
@@ -79,6 +79,22 @@ namespace MonoDevelop.Ide.FindInFiles
return true;
}
+ class FileSearchResult
+ {
+ public FileProvider Provider;
+ public TextReader Reader;
+ public List<SearchResult> Results;
+ public string Text { get; internal set; }
+
+ public FileSearchResult (FileProvider provider, TextReader reader, List<SearchResult> results)
+ {
+ Provider = provider;
+ Reader = reader;
+ Results = results;
+ }
+ }
+
+
public IEnumerable<SearchResult> FindAll (Scope scope, ProgressMonitor monitor, string pattern, string replacePattern, FilterOptions filter, CancellationToken token)
{
if (filter.RegexSearch) {
@@ -95,13 +111,13 @@ namespace MonoDevelop.Ide.FindInFiles
int step = Math.Max (1, totalWork / 50);
- var contents = new List<Tuple<FileProvider, string, List<SearchResult>>>();
+ var contents = new List<FileSearchResult>();
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> ()));
+ contents.Add(new FileSearchResult (provider, provider.ReadString (), new List<SearchResult> ()));
if (searchedFilesCount % step == 0)
monitor.Step (2);
} catch (FileNotFoundException) {
@@ -114,7 +130,7 @@ namespace MonoDevelop.Ide.FindInFiles
foreach (var content in contents) {
if (token.IsCancellationRequested)
return Enumerable.Empty<SearchResult> ();
- results.AddRange (RegexSearch (monitor, content.Item1, content.Item2, replacePattern, filter));
+ results.AddRange (RegexSearch (monitor, content.Provider, content.Reader, replacePattern, filter));
}
} else {
var options = new ParallelOptions ();
@@ -125,11 +141,15 @@ namespace MonoDevelop.Ide.FindInFiles
return;
try {
Interlocked.Increment (ref searchedFilesCount);
- content.Item3.AddRange(FindAll (monitor, content.Item1, content.Item2, pattern, replacePattern, filter));
+ if (replacePattern != null) {
+ content.Text = content.Reader.ReadToEnd ();
+ content.Reader = new StringReader (content.Text);
+ }
+ content.Results.AddRange(FindAll (monitor, content.Provider, content.Reader, pattern, replacePattern, filter));
lock (results) {
- results.AddRange (content.Item3);
+ results.AddRange (content.Results);
}
- FoundMatchesCount += content.Item3.Count;
+ FoundMatchesCount += content.Results.Count;
if (searchedFilesCount % step == 0)
monitor.Step (1);
} catch (Exception e) {
@@ -141,12 +161,12 @@ namespace MonoDevelop.Ide.FindInFiles
foreach (var content in contents) {
if (token.IsCancellationRequested)
return Enumerable.Empty<SearchResult> ();
- if (content.Item3.Count == 0)
+ if (content.Results.Count == 0)
continue;
try {
- content.Item1.BeginReplace (content.Item2);
- Replace (content.Item1, content.Item3, replacePattern);
- content.Item1.EndReplace ();
+ content.Provider.BeginReplace (content.Text);
+ Replace (content.Provider, content.Results, replacePattern);
+ content.Provider.EndReplace ();
} catch (Exception e) {
LoggingService.LogError("Exception during replace.", e);
}
@@ -161,7 +181,9 @@ namespace MonoDevelop.Ide.FindInFiles
}
}
- IEnumerable<SearchResult> FindAll (ProgressMonitor monitor, FileProvider provider, string content, string pattern, string replacePattern, FilterOptions filter)
+ // Took: 17743
+
+ IEnumerable<SearchResult> FindAll (ProgressMonitor monitor, FileProvider provider, TextReader content, string pattern, string replacePattern, FilterOptions filter)
{
if (string.IsNullOrEmpty (pattern))
return Enumerable.Empty<SearchResult> ();
@@ -172,8 +194,9 @@ namespace MonoDevelop.Ide.FindInFiles
return Search (provider, content, pattern, filter);
}
- IEnumerable<SearchResult> RegexSearch (ProgressMonitor monitor, FileProvider provider, string content, string replacePattern, FilterOptions filter)
+ IEnumerable<SearchResult> RegexSearch (ProgressMonitor monitor, FileProvider provider, TextReader reader, string replacePattern, FilterOptions filter)
{
+ string content = reader.ReadToEnd ();
var results = new List<SearchResult> ();
if (replacePattern == null) {
foreach (Match match in regex.Matches (content)) {
@@ -212,18 +235,86 @@ namespace MonoDevelop.Ide.FindInFiles
return results;
}
- public IEnumerable<SearchResult> Search (FileProvider provider, string content, string pattern, FilterOptions filter)
+ class RingBufferReader
{
- if (string.IsNullOrEmpty (content))
+ int i, l;
+ char [] buffer;
+ TextReader reader;
+
+ public RingBufferReader (TextReader reader, int bufferSize)
+ {
+ this.reader = reader;
+ buffer = new char [bufferSize];
+ }
+
+ public int Next ()
+ {
+ if (l == 0) {
+ int ch = reader.Read ();
+ buffer [i] = (char)ch;
+ i = (i + 1) % buffer.Length;
+ return ch;
+ }
+ l--;
+ var result = buffer [i];
+ i = (i + 1) % buffer.Length;
+ return result;
+ }
+
+ public void TakeBack (int num)
+ {
+ l += num;
+ i = (i + buffer.Length - num) % buffer.Length;
+ }
+ }
+
+ public IEnumerable<SearchResult> Search (FileProvider provider, TextReader reader, string pattern, FilterOptions filter)
+ {
+ if (reader == null)
yield break;
- int idx = provider.SelectionStartPosition < 0 ? 0 : Math.Max (0, provider.SelectionStartPosition);
- 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) {
- if (!filter.WholeWordsOnly || FilterOptions.IsWholeWordAt (content, idx, pattern.Length)) {
- yield return new SearchResult (provider, idx, pattern.Length);
+ int i = provider.SelectionStartPosition < 0 ? 0 : Math.Max (0, provider.SelectionStartPosition);
+ var buffer = new RingBufferReader(reader, pattern.Length + 2);
+ bool wasSeparator = true;
+ if (!filter.CaseSensitive)
+ pattern = pattern.ToUpperInvariant ();
+ while (true) {
+ int next = buffer.Next ();
+ if (next < 0)
+ yield break;
+ char ch = (char)next;
+ if ((filter.CaseSensitive ? ch : char.ToUpperInvariant (ch)) == pattern [0] &&
+ (!filter.WholeWordsOnly || wasSeparator)) {
+ bool isMatch = true;
+ for (int j = 1; j < pattern.Length; j++) {
+ next = buffer.Next ();
+ if (next < 0)
+ yield break;
+ if ((filter.CaseSensitive ? next : char.ToUpperInvariant ((char)next)) != pattern [j]) {
+ buffer.TakeBack (j);
+ isMatch = false;
+ break;
+ }
+ }
+ if (isMatch) {
+ if (filter.WholeWordsOnly) {
+ next = buffer.Next ();
+ if (next >= 0 && !FilterOptions.IsWordSeparator ((char)next)) {
+ buffer.TakeBack (pattern.Length);
+ i++;
+ continue;
+ }
+ buffer.TakeBack (1);
+ }
+
+ yield return new SearchResult (provider, i, pattern.Length);
+ i += pattern.Length - 1;
+ }
+ }
+
+ i++;
+ if (filter.WholeWordsOnly) {
+ wasSeparator = FilterOptions.IsWordSeparator ((char)ch);
}
- idx += pattern.Length;
}
}
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 d7dcacd46d..f504105b48 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs
@@ -37,11 +37,17 @@ namespace MonoDevelop.Ide.FindInFiles
{
public class SearchProgressMonitor : ProgressMonitor, ISearchProgressMonitor
{
- SearchResultPad outputPad;
+ SearchResultPad outputPad;
+
+ internal SearchResultPad ResultPad {
+ get {
+ return outputPad;
+ }
+ }
internal SearchProgressMonitor (Pad pad, CancellationTokenSource cancellationTokenSource = null): base (Runtime.MainSynchronizationContext, cancellationTokenSource)
{
- AddSlaveMonitor (IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Searching..."), Stock.StatusSearch, false, true, false, pad));
+ AddFollowerMonitor (IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Searching..."), Stock.StatusSearch, false, true, false, pad));
outputPad = (SearchResultPad) pad.Content;
outputPad.CancellationTokenSource = CancellationTokenSource;
@@ -93,14 +99,18 @@ namespace MonoDevelop.Ide.FindInFiles
protected override void OnCompleted ()
{
if (outputPad == null) throw GetDisposedException ();
+
outputPad.WriteText ("\n");
foreach (string msg in SuccessMessages)
outputPad.WriteText (msg + "\n");
+ if (CancellationToken.IsCancellationRequested)
+ ReportWarning (GettextCatalog.GetString ("Search operation canceled"));
+
foreach (string msg in Warnings)
outputPad.WriteText (msg + "\n");
-
+
foreach (var msg in Errors)
outputPad.WriteText (msg.Message + "\n");
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 c57389edd9..b1cb2d9cf5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs
@@ -33,7 +33,8 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
using System.Threading;
using MonoDevelop.Components;
-
+using System;
+
namespace MonoDevelop.Ide.FindInFiles
{
public class SearchResultPad : PadContent
@@ -100,9 +101,20 @@ namespace MonoDevelop.Ide.FindInFiles
{
window.Icon = Stock.FindIcon;
- IdeApp.Workspace.LastWorkspaceItemClosed += (sender, e) => widget.Reset ();
+ 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)
{
@@ -114,8 +126,12 @@ namespace MonoDevelop.Ide.FindInFiles
public void EndProgress ()
{
Window.IsWorking = false;
- widget.ShowStatus (" " + GettextCatalog.GetString("Search completed") + " - " +
- string.Format (GettextCatalog.GetPluralString("{0} match.", "{0} matches.", widget.ResultCount), widget.ResultCount));
+ if (CancellationTokenSource.Token.IsCancellationRequested) {
+ widget.ShowStatus (" " + GettextCatalog.GetString ("Search cancelled"));
+ } else {
+ widget.ShowStatus (" " + GettextCatalog.GetString ("Search completed") + " - " +
+ string.Format (GettextCatalog.GetPluralString ("{0} match.", "{0} matches.", widget.ResultCount), widget.ResultCount));
+ }
widget.EndProgress ();
if (FocusPad)
widget.FocusPad ();
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 1012420af4..e77549f160 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
@@ -216,8 +216,8 @@ namespace MonoDevelop.Ide.FindInFiles
void UpdateStyles (object sender = null, EventArgs e = null)
{
highlightStyle = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
- if (!highlightStyle.FitsIdeSkin (IdeApp.Preferences.UserInterfaceSkin))
- highlightStyle = SyntaxModeService.GetDefaultColorStyle (Ide.IdeApp.Preferences.UserInterfaceSkin);
+ if (!highlightStyle.FitsIdeTheme (IdeApp.Preferences.UserInterfaceTheme))
+ highlightStyle = SyntaxModeService.GetDefaultColorStyle (Ide.IdeApp.Preferences.UserInterfaceTheme);
if (markupCache != null)
markupCache = new List<Tuple<SearchResult, string>> ();
@@ -323,10 +323,10 @@ namespace MonoDevelop.Ide.FindInFiles
double delta = Math.Abs (b1 - b2);
if (delta < 0.1) {
HslColor color1 = color;
- color1.L += IdeApp.Preferences.UserInterfaceSkin == Skin.Light ? -0.5 : 0.5;
+ color1.L += IdeApp.Preferences.UserInterfaceTheme == Theme.Light ? -0.5 : 0.5;
if (Math.Abs (HslColor.Brightness (color1) - b2) < delta) {
color1 = color;
- color1.L += IdeApp.Preferences.UserInterfaceSkin == Skin.Light ? 0.5 : -0.5;
+ color1.L += IdeApp.Preferences.UserInterfaceTheme == Theme.Light ? 0.5 : -0.5;
}
return color1;
}
@@ -677,7 +677,7 @@ namespace MonoDevelop.Ide.FindInFiles
if (content == null)
return null;
- doc = TextEditorFactory.CreateNewEditor (TextEditorFactory.CreateNewReadonlyDocument (new StringTextSource (content), result.FileName, DesktopService.GetMimeTypeForUri (result.FileName)));
+ doc = TextEditorFactory.CreateNewEditor (TextEditorFactory.CreateNewReadonlyDocument (new StringTextSource (content.ReadToEnd ()), result.FileName, DesktopService.GetMimeTypeForUri (result.FileName)));
documents [result.FileName] = doc;
}
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 ad7c0c503c..32fa9375c1 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
@@ -299,7 +299,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
#endif
- void SetIconCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, Gtk.TreeModel model, Gtk.TreeIter it)
+ static void SetIconCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, Gtk.TreeModel model, Gtk.TreeIter it)
{
if (model == null)
return;
@@ -317,7 +317,7 @@ namespace MonoDevelop.Ide.Gui.Components
cell.OverlayTopRight = info.OverlayTopRight;
}
- void SetTextCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, Gtk.TreeModel model, Gtk.TreeIter it)
+ static void SetTextCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, Gtk.TreeModel model, Gtk.TreeIter it)
{
if (model == null)
return;
@@ -325,10 +325,8 @@ namespace MonoDevelop.Ide.Gui.Components
var info = (NodeInfo)model.GetValue (it, NodeInfoColumn);
var cell = (CustomCellRendererText)renderer;
- if (info.DisabledStyle)
- cell.TextMarkup = "<span foreground='gray'>" + info.Label + "</span>";
- else
- cell.TextMarkup = info.Label;
+ cell.DisabledStyle = info.DisabledStyle;
+ cell.TextMarkup = info.Label;
cell.StatusIcon = info.StatusIconInternal;
}
@@ -540,15 +538,6 @@ namespace MonoDevelop.Ide.Gui.Components
HideStatusMessage ();
}
- void HandleMenuHidden (object sender, EventArgs e)
- {
- if (sender is Gtk.Menu) {
- ((Gtk.Menu)sender).Hidden -= HandleMenuHidden;
- }
- text_render.Pushed = false;
- widget.QueueDraw ();
- }
-
internal void LockUpdates ()
{
if (++updateLockCount == 1)
@@ -2386,6 +2375,8 @@ namespace MonoDevelop.Ide.Gui.Components
set { Markup = markup = value; }
}
+ public bool DisabledStyle { get; set; }
+
[GLib.Property ("status-icon")]
public Xwt.Drawing.Image StatusIcon { get; set; }
@@ -2419,8 +2410,7 @@ namespace MonoDevelop.Ide.Gui.Components
return icon.WithSize (size);
}
-
- void SetupLayout (Gtk.Widget widget)
+ void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0)
{
if (scaledFont == null) {
if (scaledFont != null)
@@ -2438,7 +2428,15 @@ namespace MonoDevelop.Ide.Gui.Components
layout.FontDescription = scaledFont;
}
- layout.SetMarkup (TextMarkup);
+ if (DisabledStyle) {
+ Gdk.Color fgColor;
+ if (Platform.IsMac && flags.HasFlag (Gtk.CellRendererState.Selected))
+ fgColor = widget.Style.Text (IdeTheme.UserInterfaceTheme == Theme.Light ? Gtk.StateType.Selected : Gtk.StateType.Normal);
+ else
+ fgColor = widget.Style.Text (Gtk.StateType.Insensitive);
+ layout.SetMarkup ("<span foreground='" + fgColor.GetHex () + "'>" + TextMarkup + "</span>");
+ } else
+ layout.SetMarkup (TextMarkup);
}
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)
@@ -2453,7 +2451,7 @@ namespace MonoDevelop.Ide.Gui.Components
if ((flags & Gtk.CellRendererState.Selected) != 0)
st = widget.HasFocus ? Gtk.StateType.Selected : Gtk.StateType.Active;
- SetupLayout (widget);
+ SetupLayout (widget, flags);
int w, h;
layout.GetPixelSize (out w, out h);
@@ -2493,7 +2491,13 @@ namespace MonoDevelop.Ide.Gui.Components
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);
+ 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;
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 909dccb19f..adfc9c6e41 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
@@ -487,6 +487,9 @@ namespace MonoDevelop.Ide.Gui.Components
void addQueuedUpdate (QueuedUpdate update)
{
lock (updates) {
+ if (destroyed)
+ return;
+
updates.Enqueue (update);
if (!outputDispatcherRunning) {
GLib.Timeout.Add (50, outputDispatcher);
@@ -572,6 +575,9 @@ namespace MonoDevelop.Ide.Gui.Components
bool ShouldAutoScroll ()
{
+ if (scrollView == null || scrollView.Vadjustment == null)
+ return false;
+
// we need to account for the page size as well for some reason
return scrollView.Vadjustment.Value + scrollView.Vadjustment.PageSize >= scrollView.Vadjustment.Upper;
}
@@ -624,15 +630,17 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
+ bool destroyed = false;
protected override void OnDestroyed ()
{
- base.OnDestroyed ();
-
lock (updates) {
+ destroyed = true;
updates.Clear ();
lastTextWrite = null;
}
IdeApp.Preferences.CustomOutputPadFont.Changed -= HandleCustomFontChanged;
+
+ base.OnDestroyed ();
}
abstract class QueuedUpdate
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 e4209d25fd..b69fa16661 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, -1);
+ tree.ScrollToCell (store.GetPath (currentIter), pad.CompleteColumn, true, 0, 0);
}
public bool MoveToRoot ()
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 3e422e7b36..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
@@ -58,7 +58,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
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/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/OptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs
index 3f05a3965c..264ba48893 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
@@ -204,7 +204,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
DefaultHeight = 680;
}
- void PixbufCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
+ static void PixbufCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
TreeIter parent;
bool toplevel = !model.IterParent (out parent, iter);
@@ -234,7 +234,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
}
- void TextCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
+ static void TextCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
TreeIter parent;
bool toplevel = !model.IterParent (out parent, iter);
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 d659f866ec..ec5ac58a06 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
@@ -90,7 +90,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
void Load ()
{
- currentTheme = IdeApp.Preferences.UserInterfaceTheme;
+ currentTheme = IdeApp.Preferences.UserInterfaceThemeName;
for (int n = 1; n < isoCodes.Length; n += 2)
comboLanguage.AppendText (GettextCatalog.GetString (isoCodes [n]));
@@ -105,7 +105,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
foreach (string t in InstalledThemes)
comboTheme.AppendText (t);
- var sel = themes.Value.IndexOf (IdeApp.Preferences.UserInterfaceTheme);
+ var sel = themes.Value.IndexOf (IdeApp.Preferences.UserInterfaceThemeName);
if (sel == -1)
sel = 0;
else if (Platform.IsLinux)
@@ -185,8 +185,8 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
);
}
- if (currentTheme != IdeApp.Preferences.UserInterfaceTheme.Value) {
- IdeApp.Preferences.UserInterfaceTheme.Value = currentTheme;
+ if (currentTheme != IdeApp.Preferences.UserInterfaceThemeName.Value) {
+ IdeApp.Preferences.UserInterfaceThemeName.Value = currentTheme;
MessageService.ShowMessage (
GettextCatalog.GetString (
"The user interface theme change will take effect the next time you start {0}",
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 c08e3d63f0..0f412d2bd2 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
@@ -87,12 +87,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
bindingTVCol.Title = GettextCatalog.GetString ("Key Binding");
CellRendererText bindingRenderer = new CellRendererText ();
bindingTVCol.PackStart (bindingRenderer, false);
- bindingTVCol.SetCellDataFunc (bindingRenderer, delegate (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) {
- string binding = (model.GetValue (iter, bindingCol) as string) ?? "";
- ((CellRendererText)cell).Text = binding.Length > 0
- ? KeyBindingManager.BindingToDisplayLabel (binding, false)
- : binding;
- });
+ bindingTVCol.SetCellDataFunc (bindingRenderer, BindingTVDataFunc);
keyTreeView.AppendColumn (bindingTVCol);
keyTreeView.AppendColumn (GettextCatalog.GetString ("Description"), new CellRendererText (), "text", descCol);
@@ -143,6 +138,14 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
conflicButton.UseUnderline = true;
}
+ static void BindingTVDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ string binding = (model.GetValue (iter, bindingCol) as string) ?? "";
+ ((CellRendererText)cell).Text = binding.Length > 0
+ ? KeyBindingManager.BindingToDisplayLabel (binding, false)
+ : binding;
+ }
+
void Refilter ()
{
keyTreeView.Model = null;
@@ -472,7 +475,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
do {
Command command = (Command) keyStore.GetValue (citer, commandCol);
if (command == cmd) {
- TreePath path = keyStore.GetPath (citer);
+ TreePath path = filterModel.ConvertChildPathToPath (keyStore.GetPath (citer));
keyTreeView.ExpandToPath (path);
keyTreeView.Selection.SelectPath (path);
keyTreeView.ScrollToCell (path, keyTreeView.Columns[0], true, 0.5f, 0f);
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 1f4862e455..94dd433b93 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
@@ -67,7 +67,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
buttonRemove.Clicked += new EventHandler (RemoveToken);
entryToken.Changed += new EventHandler (Validate);
- Styles.Changed += HandleUserInterfaceSkinChanged;
+ Styles.Changed += HandleUserInterfaceThemeChanged;
}
void Validate (object sender, EventArgs args)
@@ -173,7 +173,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
LoadColors ();
}
- void HandleUserInterfaceSkinChanged (object sender, EventArgs e)
+ void HandleUserInterfaceThemeChanged (object sender, EventArgs e)
{
LoadColors ();
}
@@ -224,7 +224,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
public override void Destroy ()
{
- Styles.Changed -= HandleUserInterfaceSkinChanged;
+ Styles.Changed -= HandleUserInterfaceThemeChanged;
base.Destroy ();
}
}
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.ProjectPad/ProjectFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
index c943064680..a3cb32a7bb 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
@@ -79,7 +79,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
nodeInfo.Label = GLib.Markup.EscapeText (file.Link.IsNullOrEmpty ? file.FilePath.FileName : file.Link.FileName);
if (!File.Exists (file.FilePath)) {
- nodeInfo.Label = "<span foreground='red'>" + nodeInfo.Label + "</span>";
+ nodeInfo.Label = "<span foreground='" + Styles.ErrorForegroundColor.ToHexString (false) + "'>" + nodeInfo.Label + "</span>";
}
nodeInfo.Icon = DesktopService.GetIconForFile (file.FilePath, Gtk.IconSize.Menu);
@@ -181,7 +181,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
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))) {
+ } else if ((newProjectFile != null && newProjectFile != file) || FileExistsCaseSensitive (file.FilePath.ParentDirectory, newName)) {
// If there is already a file under the newPath which is *different*, then throw an exception
MessageService.ShowWarning (GettextCatalog.GetString ("File or directory name is already in use. Please choose a different one."));
} else {
@@ -195,6 +195,15 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
MessageService.ShowError (GettextCatalog.GetString ("There was an error renaming the file."), ex);
}
}
+
+ static bool FileExistsCaseSensitive (FilePath parentDirectory, string fileName)
+ {
+ if (!Directory.Exists (parentDirectory))
+ return false;
+
+ return Directory.GetFiles (parentDirectory, fileName)
+ .Any (file => Path.GetFileName (file) == fileName);
+ }
public override void ActivateItem ()
{
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 3fa984982e..f96a0dadb9 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
@@ -57,7 +57,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
SolutionFolderFileNode file = (SolutionFolderFileNode) dataObject;
nodeInfo.Label = file.FileName.FileName;
if (!System.IO.File.Exists (file.FileName))
- nodeInfo.Label = "<span foreground='red'>" + nodeInfo.Label + "</span>";
+ nodeInfo.Label = "<span foreground='" + Styles.ErrorForegroundColor.ToHexString (false) + "'>" + nodeInfo.Label + "</span>";
nodeInfo.Icon = DesktopService.GetIconForFile (file.FileName, Gtk.IconSize.Menu);
}
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 e050b1dfa2..a2dbe2aa64 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
@@ -62,13 +62,15 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
Context.CacheComposedIcon (nodeInfo.Icon, "fade", gicon);
}
nodeInfo.Icon = gicon;
- nodeInfo.Label = GettextCatalog.GetString ("<span foreground='grey'>{0} <span size='small'>(Unavailable)</span></span>", GLib.Markup.EscapeText (entry.Name));
+ nodeInfo.Label = GettextCatalog.GetString ("{0} <span size='small'>(Unavailable)</span>", GLib.Markup.EscapeText (entry.Name));
+ nodeInfo.DisabledStyle = true;
}
else if (entry.LoadError.Length > 0) {
nodeInfo.Icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project).WithAlpha (0.5);
nodeInfo.Label = entry.Name;
nodeInfo.StatusSeverity = TaskSeverity.Error;
nodeInfo.StatusMessage = GettextCatalog.GetString ("Load failed: ") + entry.LoadError;
+ nodeInfo.DisabledStyle = true;
} else {
nodeInfo.Icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project);
var gicon = Context.GetComposedIcon (nodeInfo.Icon, "fade");
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 1224e93802..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
@@ -135,9 +135,9 @@ namespace MonoDevelop.Ide.Gui.Pads
void OnButtonPinClick (object sender, EventArgs e)
{
if (buttonPin.Active)
- ((ImageView)buttonPin.Image).SetIcon ("md-pin-down", IconSize.Menu);
+ ((ImageView)buttonPin.Image).SetIcon (Stock.PinDown, IconSize.Menu);
else
- ((ImageView)buttonPin.Image).SetIcon ("md-pin-down", IconSize.Menu);
+ ((ImageView)buttonPin.Image).SetIcon (Stock.PinUp, IconSize.Menu);
}
public bool AllowReuse {
@@ -218,6 +218,8 @@ namespace MonoDevelop.Ide.Gui.Pads
logView.Clear ();
IdeApp.Workspace.FirstWorkspaceItemOpened -= OnCombineOpen;
IdeApp.Workspace.LastWorkspaceItemClosed -= OnCombineClosed;
+
+ 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 f032b032e7..debc158df8 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
@@ -271,7 +271,15 @@ namespace MonoDevelop.Ide.Gui.Pads
AddTask (t);
}
- control.FocusChain = new Gtk.Widget [] { sw };
+ control.FocusChain = new Gtk.Widget [] { outputView };
+ }
+
+ public override void Dispose ()
+ {
+ IdeApp.Workspace.FirstWorkspaceItemOpened -= OnCombineOpen;
+ IdeApp.Workspace.LastWorkspaceItemClosed -= OnCombineClosed;
+
+ base.Dispose ();
}
void HandleSwSizeAllocated (object o, SizeAllocatedArgs args)
@@ -554,10 +562,10 @@ namespace MonoDevelop.Ide.Gui.Pads
void OnTaskJumpto (object o, EventArgs args)
{
- TreeIter iter;
+ TreeIter iter, sortedIter;
TreeModel model;
- if (view.Selection.GetSelected (out model, out iter)) {
- iter = filter.ConvertIterToChildIter (sort.ConvertIterToChildIter (iter));
+ if (view.Selection.GetSelected (out model, out sortedIter)) {
+ iter = filter.ConvertIterToChildIter (sort.ConvertIterToChildIter (sortedIter));
store.SetValue (iter, DataColumns.Read, true);
TaskListEntry task = store.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task != null) {
@@ -915,8 +923,9 @@ namespace MonoDevelop.Ide.Gui.Pads
private void ItemToggled (object o, ToggledArgs args)
{
Gtk.TreeIter iter;
- if (store.GetIterFromString (out iter, args.Path)) {
- TaskListEntry task = (TaskListEntry)store.GetValue (iter, DataColumns.Task);
+
+ if (view.Model.GetIterFromString (out iter, args.Path)) {
+ TaskListEntry task = (TaskListEntry)view.Model.GetValue (iter, DataColumns.Task);
task.Completed = !task.Completed;
TaskService.FireTaskToggleEvent (this, new TaskEventArgs (task));
}
@@ -951,6 +960,12 @@ namespace MonoDevelop.Ide.Gui.Pads
aTask.FileName.CompareTo (zTask.FileName) :
0;
}
+
+ internal void FocusOutputView ()
+ {
+ logBtn.Active = true;
+ HandleLogBtnToggled (this, EventArgs.Empty);
+ }
void HandleLogBtnToggled (object sender, EventArgs e)
{
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 3f961bce6f..62a2dd0ce8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
@@ -45,6 +45,7 @@ using MonoDevelop.Components;
using MonoDevelop.Ide.Extensions;
using MonoDevelop.Components.MainToolbar;
using MonoDevelop.Components.DockNotebook;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui
{
@@ -208,7 +209,7 @@ namespace MonoDevelop.Ide.Gui
public DefaultWorkbench()
{
- Title = BrandingService.ApplicationName;
+ Title = BrandingService.ApplicationLongName;
LoggingService.LogInfo ("Creating DefaultWorkbench");
WidthRequest = normalBounds.Width;
@@ -539,9 +540,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 ()
@@ -564,8 +565,8 @@ 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)
@@ -826,6 +827,20 @@ namespace MonoDevelop.Ide.Gui
initializing = false;
}
+ Task layoutChangedTask;
+ async void LayoutChanged (object o, EventArgs e)
+ {
+ if (layoutChangedTask != null) {
+ return;
+ }
+
+ layoutChangedTask = Task.Delay (10000);
+ await layoutChangedTask;
+ layoutChangedTask = null;
+
+ dock.SaveLayouts (configFile);
+ }
+
void CreateComponents ()
{
fullViewVBox = new VBox (false, 0);
@@ -842,23 +857,7 @@ namespace MonoDevelop.Ide.Gui
// Create the docking widget and add it to the window.
dock = new DockFrame ();
- 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.LayoutChanged += LayoutChanged;
dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness.Value) + 1;
IdeApp.Preferences.WorkbenchCompactness.Changed += delegate {
@@ -1415,7 +1414,7 @@ namespace MonoDevelop.Ide.Gui
if (String.IsNullOrEmpty (windowTitle))
windowTitle = GettextCatalog.GetString (codon.Label);
if (window.HasErrors && !window.ContentVisible)
- windowTitle = "<span foreground='red'>" + windowTitle + "</span>";
+ windowTitle = "<span foreground='" + Styles.ErrorForegroundColor.ToHexString (false) + "'>" + windowTitle + "</span>";
else if (window.HasNewData && !window.ContentVisible)
windowTitle = "<b>" + windowTitle + "</b>";
item.Label = windowTitle;
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 5bd13071e7..fb526e9f18 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
@@ -551,6 +551,7 @@ namespace MonoDevelop.Ide.Gui
internal void DisposeDocument ()
{
UnsubscibeAnalysisdocument ();
+ UnsubscribeRoslynWorkspace ();
UnloadAdhocProject ();
if (window is SdiWorkspaceWindow)
((SdiWorkspaceWindow)window).DetachFromPathedDocument ();
@@ -789,14 +790,24 @@ namespace MonoDevelop.Ide.Gui
Task EnsureAnalysisDocumentIsOpen ()
{
- if (analysisDocument != null)
- return SpecializedTasks.EmptyTask;
+ if (analysisDocument != null) {
+ Microsoft.CodeAnalysis.Document doc;
+ try {
+ doc = RoslynWorkspace.CurrentSolution.GetDocument (analysisDocument);
+ } catch (Exception) {
+ doc = null;
+ }
+ if (doc != null)
+ return SpecializedTasks.EmptyTask;
+ }
if (Editor == null) {
UnsubscibeAnalysisdocument ();
return SpecializedTasks.EmptyTask;
}
if (Project != null && Editor.MimeType == "text/x-csharp" && !IsUnreferencedSharedProject(Project)) {
+ UnsubscribeRoslynWorkspace ();
RoslynWorkspace = TypeSystemService.GetWorkspace (this.Project.ParentSolution);
+ SubscribeRoslynWorkspace ();
analysisDocument = TypeSystemService.GetDocumentId (this.Project, this.FileName);
if (analysisDocument != null) {
TypeSystemService.InformDocumentOpen (analysisDocument, Editor);
@@ -832,7 +843,9 @@ namespace MonoDevelop.Ide.Gui
return TypeSystemService.Load (adhocSolution, new ProgressMonitor (), token).ContinueWith (task => {
if (token.IsCancellationRequested)
return;
+ UnsubscribeRoslynWorkspace ();
RoslynWorkspace = task.Result.FirstOrDefault(); // 1 solution loaded ->1 workspace as result
+ SubscribeRoslynWorkspace ();
analysisDocument = TypeSystemService.GetDocumentId (RoslynWorkspace, newProject, adHocFile);
TypeSystemService.InformDocumentOpen (RoslynWorkspace, analysisDocument, Editor);
});
@@ -842,6 +855,27 @@ namespace MonoDevelop.Ide.Gui
return SpecializedTasks.EmptyTask;
}
+ void UnsubscribeRoslynWorkspace ()
+ {
+ var ws = RoslynWorkspace as MonoDevelopWorkspace;
+ if (ws != null) {
+ ws.ProjectReloaded -= HandleRoslynProjectReload;
+ }
+ }
+
+ void SubscribeRoslynWorkspace ()
+ {
+ var ws = RoslynWorkspace as MonoDevelopWorkspace;
+ if (ws != null) {
+ ws.ProjectReloaded += HandleRoslynProjectReload;
+ }
+ }
+
+ void HandleRoslynProjectReload (object sender, RoslynProjectEventArgs e)
+ {
+ StartReparseThread ();
+ }
+
bool IsUnreferencedSharedProject (Project project)
{
return project is SharedAssetsProject;
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 756be72f31..87711863d5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs
@@ -279,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 ()
@@ -295,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/PadContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs
index c173e1c009..e559040477 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs
@@ -75,6 +75,7 @@ namespace MonoDevelop.Ide.Gui
public virtual void Dispose ()
{
+ Control?.Dispose ();
}
}
}
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 3b85a18590..4373d151ee 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;
@@ -44,8 +45,8 @@ namespace MonoDevelop.Ide.Gui
{
public class ProgressMonitorManager : GuiSyncObject
{
- ArrayList searchMonitors = new ArrayList ();
- ArrayList outputMonitors = new ArrayList ();
+ List<Pad> searchMonitors = new List<Pad> ();
+ List<Pad> outputMonitors = new List<Pad> ();
/******************************/
@@ -73,7 +74,7 @@ namespace MonoDevelop.Ide.Gui
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;
}
@@ -157,6 +158,8 @@ namespace MonoDevelop.Ide.Gui
/// </remarks>
public Pad GetPadForMonitor (ProgressMonitor monitor)
{
+ Runtime.AssertMainThread ();
+
foreach (Pad pad in outputMonitors) {
DefaultMonitorPad p = (DefaultMonitorPad) pad.Content;
if (p.CurrentMonitor == monitor)
@@ -216,7 +219,9 @@ namespace MonoDevelop.Ide.Gui
monitorPad.StatusSourcePad = pad;
pad.Sticky = true;
- outputMonitors.Add (pad);
+ lock (outputMonitors) {
+ outputMonitors.Add (pad);
+ }
if (instanceCount > 0) {
// Additional output pads will be destroyed when hidden
@@ -237,7 +242,9 @@ namespace MonoDevelop.Ide.Gui
void DestroyPad (Pad pad)
{
- outputMonitors.Remove (pad);
+ lock (outputMonitors) {
+ outputMonitors.Remove (pad);
+ }
pad.Destroy ();
}
@@ -280,11 +287,12 @@ namespace MonoDevelop.Ide.Gui
lock (searchMonitors) {
searchMonitors.Add (pad);
- if (searchMonitors.Count > 1) {
+ 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 (searchMonitors) {
- searchMonitors.Remove (pad);
+ lock (searchMonitorsCopy) {
+ searchMonitorsCopy.Remove (pad);
}
pad.Destroy ();
};
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 acf648032b..0977dfdd84 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Ide.Gui
public GtkProjectLoadProgressMonitor (ProgressMonitor monitor): base (Runtime.MainSynchronizationContext)
{
- AddSlaveMonitor (monitor);
+ AddFollowerMonitor (monitor);
}
public override void Dispose ()
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 5ca86e259b..d1c1341261 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
@@ -112,8 +112,7 @@ namespace MonoDevelop.Ide.Gui
// which will add the content control to the subview notebook. In that case, we don't need to add it to box
if (subViewNotebook == null)
box.PackStart (content.Control);
-
- content.ContentNameChanged += new EventHandler(SetTitleEvent);
+ content.ContentNameChanged += SetTitleEvent;
content.DirtyChanged += HandleDirtyChanged;
box.Show ();
Add (box);
@@ -485,7 +484,7 @@ namespace MonoDevelop.Ide.Gui
}
if (content != null) {
- content.ContentNameChanged -= new EventHandler(SetTitleEvent);
+ content.ContentNameChanged -= SetTitleEvent;
content.DirtyChanged -= HandleDirtyChanged;
content.WorkbenchWindow = null;
content.Dispose ();
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 567a3111cb..fa029271ab 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StockIcons.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StockIcons.cs
@@ -163,5 +163,6 @@ namespace MonoDevelop.Ide.Gui
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 ccbf870986..0b1886a2e2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs
@@ -143,20 +143,10 @@ namespace MonoDevelop.Ide.Gui
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 double? pixelScale = null;
-
- static double PixelScale {
- get {
- if (!pixelScale.HasValue)
- pixelScale = GtkWorkarounds.GetPixelScale ();
- return (double)pixelScale;
- }
- }
+ public static int StatusFontPixelHeight { get { return 11; } }
+ public static int ProgressBarHeight { get { return 18; } }
+ public static int ProgressBarInnerPadding { get { return 4; } }
+ public static int ProgressBarOuterPadding { get { return 4; } }
// Toolbar
@@ -320,7 +310,7 @@ namespace MonoDevelop.Ide.Gui
DefaultFont = defaultStyle.FontDescription.Copy ();
DefaultFontName = DefaultFont.ToString ();
- if (IdeApp.Preferences == null || IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ if (IdeApp.Preferences == null || IdeApp.Preferences.UserInterfaceTheme == Theme.Light)
LoadLightStyle ();
else
LoadDarkStyle ();
@@ -584,7 +574,7 @@ namespace MonoDevelop.Ide.Gui
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.ShadowColor = Color.FromName ("#000000").WithAlpha (0); // transparent since dark theme doesn't need shadows
PopoverWindow.ParamaterWindows.GradientStartColor = Color.FromName ("#fffee6");
PopoverWindow.ParamaterWindows.GradientEndColor = Color.FromName ("#fffcd1");
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs
index e7f69e98e4..a7d535107b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs
@@ -60,7 +60,7 @@ namespace MonoDevelop.Ide.Gui
}
public bool IsUntitled {
- get { return (contentName == null); }
+ get { return (ContentName == null); }
}
public virtual bool IsDirty {
@@ -99,7 +99,7 @@ namespace MonoDevelop.Ide.Gui
public virtual Task Save ()
{
- return Save (contentName);
+ return Save (ContentName);
}
public Task Save (FilePath fileName)
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 0d553cb966..77f6ed169f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
@@ -55,6 +55,7 @@ using MonoDevelop.Ide.Editor;
using MonoDevelop.Components;
using System.Threading.Tasks;
using System.Collections.Immutable;
+using MonoDevelop.Core.Instrumentation;
namespace MonoDevelop.Ide.Gui
{
@@ -145,11 +146,18 @@ namespace MonoDevelop.Ide.Gui
{
return workbench.Close();
}
-
+
public ImmutableList<Document> Documents {
get { return documents; }
}
+ /// <summary>
+ /// This is a wrapper for use with AutoTest
+ /// </summary>
+ internal bool DocumentsDirty {
+ get { return Documents.Any (d => d.IsDirty); }
+ }
+
public Document ActiveDocument {
get {
if (workbench.ActiveWorkbenchWindow == null)
@@ -316,12 +324,17 @@ namespace MonoDevelop.Ide.Gui
public void SaveAll ()
{
- // Make a copy of the list, since it may change during save
- Document[] docs = new Document [Documents.Count];
- Documents.CopyTo (docs, 0);
-
- foreach (Document doc in docs)
- doc.Save ();
+ ITimeTracker tt = Counters.SaveAllTimer.BeginTiming ();
+ try {
+ // Make a copy of the list, since it may change during save
+ Document[] docs = new Document [Documents.Count];
+ Documents.CopyTo (docs, 0);
+
+ foreach (Document doc in docs)
+ doc.Save ();
+ } finally {
+ tt.End ();
+ }
}
internal bool SaveAllDirtyFiles ()
@@ -1083,6 +1096,10 @@ namespace MonoDevelop.Ide.Gui
activeDoc = doc;
}
+ if (activeDoc == null) {
+ activeDoc = docViews.Select (t => WrapDocument (t.Item1.WorkbenchWindow)).FirstOrDefault ();
+ }
+
foreach (PadUserPrefs pi in prefs.Pads) {
foreach (Pad pad in IdeApp.Workbench.Pads) {
@@ -1305,20 +1322,31 @@ namespace MonoDevelop.Ide.Gui
}
System.Timers.Timer tabsChangedTimer = null;
- void WorkbenchTabsChanged (object sender, EventArgs ev)
+
+ void DisposeTimerAndSave (object o, EventArgs e)
{
- if (tabsChangedTimer != null) {
+ 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.Elapsed += async (s, e) => {
- await IdeApp.Workspace.SaveAsync ();
- tabsChangedTimer.Stop ();
- tabsChangedTimer.Dispose ();
- tabsChangedTimer = null;
- };
+ tabsChangedTimer.AutoReset = false;
+ tabsChangedTimer.Elapsed += DisposeTimerAndSave;
tabsChangedTimer.Start ();
}
}
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 a8e296f91d..1b64831c41 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
@@ -81,11 +81,9 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
if (ConfiguredSolution != null && widget.ResourceNamingChanged) {
string msg = GettextCatalog.GetString ("The resource naming policy has changed");
- string detail = "Changing the resource naming policy may cause run-time errors if the code using resources is not properly updated. There are two options:\n\n";
- detail += GettextCatalog.GetString ("Update all resource identifiers to match the new policy. This will require changes in the source code that references resources using the old policy. Identifiers explicitly set using the file properties pad won't be changed.\n\n");
- detail += "Keep curent resource identifiers. It doesn't require source code changes. Resources added from now on will use the new policy)";
- AlertButton update = new AlertButton ("Update Identifiers");
- AlertButton keep = new AlertButton ("Keep Current Identifiers");
+ string detail = GettextCatalog.GetString ("Changing the resource naming policy may cause run-time errors if the code using resources is not properly updated. There are two options:\n\nUpdate all resource identifiers to match the new policy. This will require changes in the source code that references resources using the old policy. Identifiers explicitly set using the file properties pad won't be changed.\n\nKeep curent resource identifiers. It doesn't require source code changes. Resources added from now on will use the new policy.");
+ AlertButton update = new AlertButton (GettextCatalog.GetString ("Update Identifiers"));
+ AlertButton keep = new AlertButton (GettextCatalog.GetString ("Keep Current Identifiers"));
AlertButton res = MessageService.AskQuestion (msg, detail, AlertButton.Cancel, update, keep);
if (res == AlertButton.Cancel)
return false;
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 2e006bad7e..e1f38890e7 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
@@ -227,14 +227,10 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
string FormatTargetFramework (TargetFramework fx)
{
- string description;
if (fx == missingFramework)
- description = " - not installed";
+ return GettextCatalog.GetString ("PCL {0} - {1} - not installed", fx.Id.Version, fx.Id.Profile);
else
- description = string.Empty;
-
- return string.Format (
- "PCL {0} - {1}{2}", fx.Id.Version, fx.Id.Profile, description);
+ return GettextCatalog.GetString ("PCL {0} - {1}", fx.Id.Version, fx.Id.Profile);
}
IEnumerable<TargetFramework> GetPortableTargetFrameworks ()
@@ -249,11 +245,11 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
void CreateUI ()
{
- AddLabel ("Current Profile:", 0);
+ AddLabel (GettextCatalog.GetString ("Current Profile:"), 0);
AddTopSelectorCombo ();
- AddLabel ("Target Frameworks:", 18);
+ AddLabel (GettextCatalog.GetString ("Target Frameworks:"), 18);
// Add multi-option combo boxes first
foreach (var opt in options) {
@@ -410,7 +406,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
TopPadding = 8, LeftPadding = 18, RightPadding = 18
};
- warning = new Label ("Test Error");
+ warning = new Label (GettextCatalog.GetString ("Test Error"));
warning.SetAlignment (0.0f, 0.5f);
warning.Show ();
@@ -504,7 +500,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
var selectedOptions = options.Where (o => o.Check.Active).ToList ();
if (selectedOptions.Count < 2) {
- SetWarning ("Need to select at least two frameworks.");
+ SetWarning (GettextCatalog.GetString ("Need to select at least two frameworks."));
return;
}
@@ -520,7 +516,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
f => IsApplicable (f, true, selectedFrameworks)).ToList ();
if (applicable.Count == 0) {
- AddWarning ("No applicable frameworks for this selection!");
+ AddWarning (GettextCatalog.GetString ("No applicable frameworks for this selection!"));
return;
}
@@ -540,9 +536,9 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
return;
} else if (exactMatches.Count > 1) {
// This should never happen.
- AddWarning ("Multiple frameworks match the current selection:");
+ AddWarning (GettextCatalog.GetString ("Multiple frameworks match the current selection:"));
exactMatches.ForEach (e => AddWarning (" " + e.Id));
- AddWarning ("You must manually pick a profile in the drop-down selector.");
+ AddWarning (GettextCatalog.GetString ("You must manually pick a profile in the drop-down selector."));
// This is very bad UX, we should really disable "Ok" / add an "Apply"
// button, but it's better than nothing.
target = exactMatches [0];
@@ -563,14 +559,13 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
if (common.Count == 0) {
// Ok, the user must pick something.
- AddWarning ("Found multiple applicable frameworks, you need to " +
- "select additional check boxes.");
+ AddWarning (GettextCatalog.GetString ("Found multiple applicable frameworks, you need to select additional check boxes."));
// Same here: randomly pick a profile to make "Ok" happy.
target = applicable [0];
return;
}
- AddInfo ("The following frameworks have been implicitly selected:");
+ AddInfo (GettextCatalog.GetString ("The following frameworks have been implicitly selected:"));
AddInfo (" " + string.Join (", ", common.Select (c => GetDisplayName (c))));
// Implicitly select them.
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 d3c485f71b..b10e87b681 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs
@@ -127,7 +127,7 @@ namespace MonoDevelop.Ide.Projects
try {
pset.SaveToFile (file);
} catch (Exception ex) {
- MessageService.ShowError ("The policy file could not be saved", ex);
+ MessageService.ShowError (GettextCatalog.GetString ("The policy file could not be saved"), ex);
return;
}
}
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 335e237d7d..0ccd83e6c3 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
@@ -99,8 +99,8 @@ namespace MonoDevelop.Ide.Projects
void Build ()
{
BorderWidth = 0;
- WidthRequest = GtkWorkarounds.ConvertToPixelScale (901);
- HeightRequest = GtkWorkarounds.ConvertToPixelScale (632);
+ WidthRequest = 901;
+ HeightRequest = 632;
Name = "wizard_dialog";
Title = GettextCatalog.GetString ("New Project");
@@ -113,7 +113,7 @@ namespace MonoDevelop.Ide.Projects
// Top banner of dialog.
var topLabelEventBox = new EventBox ();
topLabelEventBox.Name = "topLabelEventBox";
- topLabelEventBox.HeightRequest = GtkWorkarounds.ConvertToPixelScale (52);
+ topLabelEventBox.HeightRequest = 52;
topLabelEventBox.ModifyBg (StateType.Normal, bannerBackgroundColor);
topLabelEventBox.ModifyFg (StateType.Normal, whiteColor);
topLabelEventBox.BorderWidth = 0;
@@ -158,7 +158,7 @@ namespace MonoDevelop.Ide.Projects
templateCategoriesBgBox.Name = "templateCategoriesVBox";
templateCategoriesBgBox.BorderWidth = 0;
templateCategoriesBgBox.ModifyBg (StateType.Normal, categoriesBackgroundColor);
- templateCategoriesBgBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale (220);
+ templateCategoriesBgBox.WidthRequest = 220;
var templateCategoriesScrolledWindow = new ScrolledWindow ();
templateCategoriesScrolledWindow.Name = "templateCategoriesScrolledWindow";
templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;
@@ -178,7 +178,7 @@ namespace MonoDevelop.Ide.Projects
var templatesBgBox = new EventBox ();
templatesBgBox.ModifyBg (StateType.Normal, templateListBackgroundColor);
templatesBgBox.Name = "templatesVBox";
- templatesBgBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale (400);
+ templatesBgBox.WidthRequest = 400;
templatesHBox.PackStart (templatesBgBox, false, false, 0);
var templatesScrolledWindow = new ScrolledWindow ();
templatesScrolledWindow.Name = "templatesScrolledWindow";
@@ -207,21 +207,21 @@ namespace MonoDevelop.Ide.Projects
// Template large image.
templateImage = new ImageView ();
templateImage.Name = "templateImage";
- templateImage.HeightRequest = GtkWorkarounds.ConvertToPixelScale (140);
- templateImage.WidthRequest = GtkWorkarounds.ConvertToPixelScale (240);
+ templateImage.HeightRequest = 140;
+ templateImage.WidthRequest = 240;
templateVBox.PackStart (templateImage, false, false, 10);
// Template description.
templateNameLabel = new Label ();
templateNameLabel.Name = "templateNameLabel";
- templateNameLabel.WidthRequest = GtkWorkarounds.ConvertToPixelScale (240);
+ templateNameLabel.WidthRequest = 240;
templateNameLabel.Wrap = true;
templateNameLabel.Xalign = 0;
templateNameLabel.Markup = MarkupTemplateName ("TemplateName");
templateVBox.PackStart (templateNameLabel, false, false, 0);
templateDescriptionLabel = new Label ();
templateDescriptionLabel.Name = "templateDescriptionLabel";
- templateDescriptionLabel.WidthRequest = GtkWorkarounds.ConvertToPixelScale (240);
+ templateDescriptionLabel.WidthRequest = 240;
templateDescriptionLabel.Wrap = true;
templateDescriptionLabel.Xalign = 0;
templateVBox.PackStart (templateDescriptionLabel, false, false, 0);
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 e7c2b1b2bd..73897056b3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs
@@ -90,16 +90,18 @@ namespace MonoDevelop.Ide.Projects
SelectTemplateDefinedbyController ();
}
- void SetTemplateCategoryCellData (TreeViewColumn col, CellRenderer renderer, TreeModel model, TreeIter it)
+ static void SetTemplateCategoryCellData (TreeViewColumn col, CellRenderer renderer, TreeModel model, TreeIter it)
{
+ var categoryTextRenderer = (GtkTemplateCategoryCellRenderer)renderer;
categoryTextRenderer.Category = (TemplateCategory)model.GetValue (it, TemplateCategoryColumn);
categoryTextRenderer.CategoryIcon = model.GetValue (it, TemplateCategoryIconColumn) as Xwt.Drawing.Image;
categoryTextRenderer.CategoryName = model.GetValue (it, TemplateCategoryNameColumn) as string;
}
- void SetTemplateTextCellData (TreeViewColumn col, CellRenderer renderer, TreeModel model, TreeIter it)
+ static void SetTemplateTextCellData (TreeViewColumn col, CellRenderer renderer, TreeModel model, TreeIter it)
{
var template = (SolutionTemplate)model.GetValue (it, TemplateColumn);
+ var templateTextRenderer = (GtkTemplateCellRenderer)renderer;
templateTextRenderer.Template = template;
templateTextRenderer.TemplateIcon = model.GetValue (it, TemplateIconColumn) as Xwt.Drawing.Image;
templateTextRenderer.TemplateCategory = model.GetValue (it, TemplateNameColumn) as string;
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 832aa2bcbc..79e5cc4887 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs
@@ -116,8 +116,7 @@ namespace MonoDevelop.Ide.Projects
SetMarkup (layout, GetSelectedLanguage ());
layout.GetPixelSize (out textWidth, out textHeight);
- double scale = GtkWorkarounds.GetPixelScale ();
- languageRect = GetLanguageButtonRectangle (window, widget, cell_area, textHeight, textWidth, scale);
+ languageRect = GetLanguageButtonRectangle (window, widget, cell_area, textHeight, textWidth);
DrawTemplateNameText (window, widget, cell_area, iconRect, languageRect, flags);
@@ -125,7 +124,7 @@ namespace MonoDevelop.Ide.Projects
SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToCairoColor ());
ctx.Fill ();
- int languageTextX = languageRect.X + GetLanguageLeftHandPadding (scale);
+ int languageTextX = languageRect.X + languageLeftHandPadding;
if (!TemplateHasMultipleLanguages ()) {
languageTextX = languageRect.X + (languageRect.Width - textWidth) / 2;
}
@@ -134,30 +133,14 @@ namespace MonoDevelop.Ide.Projects
window.DrawLayout (widget.Style.TextGC (StateType.Normal), languageTextX, languageTextY, layout);
if (TemplateHasMultipleLanguages ()) {
- int triangleX = languageTextX + textWidth + GetLanguageRightHandPadding (scale);
- int triangleY = languageRect.Y + (languageRect.Height - ((int)(scale * dropdownTriangleHeight))) / 2;
- DrawTriangle (ctx, triangleX, triangleY, scale);
+ int triangleX = languageTextX + textWidth + languageRightHandPadding;
+ int triangleY = languageRect.Y + (languageRect.Height - dropdownTriangleHeight) / 2;
+ DrawTriangle (ctx, triangleX, triangleY);
}
}
}
}
- int GetLanguageLeftHandPadding (double scale)
- {
- if (Platform.IsWindows && scale > 1.0) {
- return (int)(scale * (languageLeftHandPadding + 3));
- }
- return languageLeftHandPadding;
- }
-
- int GetLanguageRightHandPadding (double scale)
- {
- if (Platform.IsWindows && scale > 1.0) {
- return (int)(scale * languageRightHandPadding);
- }
- return languageRightHandPadding;
- }
-
void DrawTemplateCategoryText (Drawable window, Widget widget, Rectangle cell_area, CellRendererState flags)
{
StateType state = GetState (widget, flags);
@@ -250,7 +233,7 @@ namespace MonoDevelop.Ide.Projects
layout.SetMarkup (markup);
}
- Rectangle GetLanguageButtonRectangle (Drawable window, Widget widget, Rectangle cell_area, int textHeight, int textWidth, double scale)
+ Rectangle GetLanguageButtonRectangle (Drawable window, Widget widget, Rectangle cell_area, int textHeight, int textWidth)
{
int languageRectangleHeight = cell_area.Height - 8;
int languageRectangleWidth = textWidth + languageLeftHandPadding;
@@ -261,8 +244,6 @@ namespace MonoDevelop.Ide.Projects
languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth);
}
- languageRectangleWidth = (int)(scale * languageRectangleWidth);
-
var dy = (cell_area.Height - languageRectangleHeight) / 2 - 1;
var y = cell_area.Y + dy;
var x = widget.Allocation.Width - languageRectangleWidth - (int)Xpad;
@@ -275,10 +256,10 @@ namespace MonoDevelop.Ide.Projects
return Template.AvailableLanguages.Count > 1;
}
- void DrawTriangle (Cairo.Context ctx, int x, int y, double scale)
+ void DrawTriangle (Cairo.Context ctx, int x, int y)
{
- int width = (int)(scale * dropdownTriangleWidth);
- int height = (int)(scale * dropdownTriangleHeight);
+ int width = dropdownTriangleWidth;
+ int height = dropdownTriangleHeight;
SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonTriangle.ToCairoColor ());
ctx.MoveTo (x, y);
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 dc254ada5b..578d8812f2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs
@@ -493,7 +493,7 @@ namespace MonoDevelop.Ide.Projects
return;
} catch (Exception ex) {
LoggingService.LogError ("Error creating file", ex);
- MessageService.ShowException (ex);
+ MessageService.ShowError (GettextCatalog.GetString ("Error creating file"), ex);
return;
}
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 6c787743d5..ea7eb0d0a2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectController.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectController.cs
@@ -427,7 +427,7 @@ namespace MonoDevelop.Ide.Projects
if (template != null) {
return template;
}
- throw new ApplicationException (String.Format ("No template found matching condition '{0}'.", SelectedTemplate.Condition));
+ throw new ApplicationException (GettextCatalog.GetString ("No template found matching condition '{0}'.", SelectedTemplate.Condition));
}
return GetSelectedTemplateForSelectedLanguage ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs
index a006d0b259..6f7aafa6eb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs
@@ -118,7 +118,7 @@ namespace MonoDevelop.Ide.Projects
};
searchEntry.WidthRequest = 150;
- searchEntry.EmptyMessage = GettextCatalog.GetString ("Search...");
+ searchEntry.EmptyMessage = GettextCatalog.GetString ("Search…");
searchEntry.Changed += delegate {
templateView.SetSearchFilter (searchEntry.Entry.Text);
};
@@ -536,7 +536,7 @@ namespace MonoDevelop.Ide.Projects
return filterFunc (item);
}
- void CellDataFuncText (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
+ static void CellDataFuncText (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var item = (TemplateItem) model.GetValue (iter, 0);
string name = GLib.Markup.EscapeText (item.Name);
@@ -546,7 +546,7 @@ namespace MonoDevelop.Ide.Projects
((CellRendererText)cell).Markup = name;
}
- void CellDataFuncIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
+ static void CellDataFuncIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var item = (TemplateItem) model.GetValue (iter, 0);
var id = item.Template.Icon.IsNull ? "md-project" : item.Template.Icon.ToString ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs
index 769ba00227..e39ad85d3e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs
@@ -238,8 +238,13 @@ namespace MonoDevelop.Ide.Tasks
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));
+ if (System.IO.File.Exists (file)) {
+ var project = WorkspaceObject as Project;
+ IdeApp.Workbench.OpenDocument (file, project, Math.Max (1, line), Math.Max (1, column));
+ } else {
+ var pad = IdeApp.Workbench.GetPad<ErrorListPad> ()?.Content as ErrorListPad;
+ pad?.FocusOutputView ();
+ }
} else if (parentObject != null) {
Pad pad = IdeApp.Workbench.GetPad<ProjectSolutionPad> ();
ProjectSolutionPad spad = pad.Content as ProjectSolutionPad;
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 cc801626f4..440d066a52 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
@@ -210,10 +210,10 @@ namespace MonoDevelop.Ide.Tasks
TaskService.UserTasks.Add (task);
updating = false;
TreeIter iter = 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);
- view.Selection.SelectIter (iter);
- TreePath path = store.GetPath (iter);
- view.ScrollToCell (path, view.Columns[(int)Columns.Description], true, 0, 0);
- view.SetCursorOnCell (path, view.Columns[(int)Columns.Description], cellRendDesc, true);
+ view.Selection.SelectIter (sortModel.ConvertChildIterToIter (iter));
+ TreePath sortedPath = sortModel.ConvertChildPathToPath (store.GetPath (iter));
+ view.ScrollToCell (sortedPath, view.Columns[(int)Columns.Description], true, 0, 0);
+ view.SetCursorOnCell (sortedPath, view.Columns[(int)Columns.Description], cellRendDesc, true);
TaskService.SaveUserTasks (task.WorkspaceObject);
}
@@ -241,7 +241,8 @@ namespace MonoDevelop.Ide.Tasks
if (view.Selection.CountSelectedRows () > 0)
{
TreeIter iter;
- if (store.GetIter (out iter, view.Selection.GetSelectedRows ()[0]))
+ Gtk.TreePath path = sortModel.ConvertPathToChildPath (view.Selection.GetSelectedRows () [0]);
+ if (store.GetIter (out iter, path))
{
TaskListEntry task = (TaskListEntry) store.GetValue (iter, (int)Columns.UserTask);
updating = true;
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 90fb04d2fc..24caf85ee0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs
@@ -59,7 +59,7 @@ namespace MonoDevelop.Ide.Templates
public override string CreateContent (Project project, Dictionary<string, string> tags, string language)
{
if (language == null || language == "")
- throw new InvalidOperationException ("Language not defined in CodeDom based template.");
+ throw new InvalidOperationException (GettextCatalog.GetString ("Language not defined in CodeDom based template."));
var binding = GetLanguageBinding (language);
@@ -68,7 +68,7 @@ namespace MonoDevelop.Ide.Templates
provider = binding.GetCodeDomProvider ();
if (provider == null)
- throw new InvalidOperationException ("The language '" + language + "' does not have support for CodeDom.");
+ throw new InvalidOperationException (GettextCatalog.GetString ("The language '{0}' does not have support for CodeDom.", language));
var xcd = new XmlCodeDomReader ();
var cu = xcd.ReadCompileUnit (domContent);
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 c410fe43c8..396ff970fb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs
@@ -84,21 +84,20 @@ namespace MonoDevelop.Ide.Templates
{
//get target language's ICodeGenerator
if (language == null || language == "")
- throw new InvalidOperationException ("Language not defined in CodeDom based template.");
+ throw new InvalidOperationException (GettextCatalog.GetString ("Language not defined in CodeDom based template."));
CodeDomProvider provider = GetCodeDomProvider (language);
//parse the source code
if (tempSubstitutedContent == null)
- throw new Exception ("Expected ModifyTags to be called before CreateContent");
+ throw new Exception (GettextCatalog.GetString ("Expected ModifyTags to be called before CreateContent"));
CodeCompileUnit ccu;
using (StringReader sr = new StringReader (tempSubstitutedContent)) {
try {
ccu = parserProvider.Parse (sr);
} catch (NotImplementedException) {
- throw new InvalidOperationException ("Invalid Code Translation template: the CodeDomProvider of the source language '"
- + language + "' has not implemented the Parse method.");
+ throw new InvalidOperationException (GettextCatalog.GetString ("Invalid Code Translation template: the CodeDomProvider of the source language '{0}' has not implemented the Parse method.", language));
} catch (Exception ex) {
LoggingService.LogError ("Unparseable template: '" + tempSubstitutedContent + "'.", ex);
throw;
@@ -158,11 +157,11 @@ namespace MonoDevelop.Ide.Templates
System.CodeDom.Compiler.CodeDomProvider provider = null;
var binding = GetLanguageBinding (language);
if (binding == null)
- throw new InvalidOperationException ("No LanguageBinding was found for the language '" + language + "'.");
+ throw new InvalidOperationException (GettextCatalog.GetString ("No LanguageBinding was found for the language '{0}'.", language));
provider = binding.GetCodeDomProvider ();
if (provider == null)
- throw new InvalidOperationException ("No CodeDomProvider was found for the language '" + language + "'.");
+ throw new InvalidOperationException (GettextCatalog.GetString ("No CodeDomProvider was found for the language '{0}'.", language));
return provider;
}
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 1c687a65a9..623728dfee 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs
@@ -328,7 +328,7 @@ namespace MonoDevelop.Ide.Templates
public IEnumerable<SolutionItem> CreateProjects (SolutionFolderItem policyParent, ProjectCreateInformation cInfo)
{
if (solutionDescriptor.EntryDescriptors.Length == 0)
- throw new InvalidOperationException ("Solution template doesn't have any project templates");
+ throw new InvalidOperationException (GettextCatalog.GetString ("Solution template doesn't have any project templates"));
var solutionEntryItems = new List<SolutionItem> ();
packageReferencesForCreatedProjects = new List<PackageReferencesForCreatedProject> ();
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 6be284a7d4..4582d57c89 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs
@@ -243,7 +243,7 @@ namespace MonoDevelop.Ide.Templates
}
if (fileName == null)
- throw new InvalidOperationException ("File name not provided in template");
+ throw new InvalidOperationException (GettextCatalog.GetString ("File name not provided in template"));
//give it an extension if it didn't get one (compatibility with pre-substition behaviour)
if (Path.GetExtension (fileName).Length == 0) {
@@ -366,7 +366,7 @@ namespace MonoDevelop.Ide.Templates
{
var binding = LanguageBindingService.GetBindingPerLanguageName (language);
if (binding == null)
- throw new InvalidOperationException ("Language '" + language + "' not found");
+ throw new InvalidOperationException (GettextCatalog.GetString ("Language '{0}' not found", language));
return binding;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/XmlCodeDomReader.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/XmlCodeDomReader.cs
index c79de6cd36..848f782044 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/XmlCodeDomReader.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/XmlCodeDomReader.cs
@@ -32,6 +32,7 @@ using System.Reflection;
using System.CodeDom;
using System.Collections;
using System.CodeDom.Compiler;
+using MonoDevelop.Core;
namespace MonoDevelop.Ide.Templates
{
@@ -57,7 +58,7 @@ namespace MonoDevelop.Ide.Templates
if (prop == null) {
if (att.Name.EndsWith ("Type") && type.GetProperty (att.Name.Substring (0, att.Name.Length - 4)) != null)
continue;
- throw new InvalidOperationException ("Property '" + att.Name + "' not found in type '" + type + "'.");
+ throw new InvalidOperationException (GettextCatalog.GetString ("Property '{0}' not found in type '{1}'.", att.Name, type));
}
Type ptype = null;
@@ -78,7 +79,7 @@ namespace MonoDevelop.Ide.Templates
PropertyInfo prop = type.GetProperty (celem.Name);
if (prop == null)
- throw new InvalidOperationException ("Property '" + celem.Name + "' not found in type '" + type + "'.");
+ throw new InvalidOperationException (GettextCatalog.GetString ("Property '{0}' not found in type '{1}'.", celem.Name, type));
if (typeof(IEnumerable).IsAssignableFrom (prop.PropertyType)) {
object col = prop.GetValue (ob, null);
@@ -117,7 +118,7 @@ namespace MonoDevelop.Ide.Templates
}
if (methods.Count == 0)
- throw new InvalidOperationException ("Add method not found in " + type);
+ throw new InvalidOperationException (GettextCatalog.GetString ("Add method not found in {0}", type));
foreach (XmlNode node in elem.ChildNodes) {
XmlElement celem = node as XmlElement;
@@ -150,7 +151,7 @@ namespace MonoDevelop.Ide.Templates
{
Type type = typeof(CodeObject).Assembly.GetType ("System.CodeDom.Code" + elemName);
if (type == null)
- throw new InvalidOperationException ("Type not found for element: " + elemName);
+ throw new InvalidOperationException (GettextCatalog.GetString ("Type not found for element: {0}", elemName));
return type;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
index 0c282f163c..f2e76105d0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
@@ -66,7 +66,11 @@ namespace MonoDevelop.Ide.TypeSystem
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)));
+ try {
+ handler (this, new Microsoft.CodeAnalysis.Text.TextChangeEventArgs (oldText, newText, new TextChangeRange (TextSpan.FromBounds (e.Offset, e.Offset + e.RemovalLength), e.InsertionLength)));
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while text replacing", ex);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
index bfa4238645..ff10c6572e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
@@ -155,7 +155,7 @@ namespace MonoDevelop.Ide.TypeSystem
});
}
- void HandleActiveConfigurationChanged (object sender, EventArgs e)
+ async void HandleActiveConfigurationChanged (object sender, EventArgs e)
{
if (currentMonoDevelopSolution == null)
return;
@@ -163,61 +163,60 @@ namespace MonoDevelop.Ide.TypeSystem
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 ();
- }
- });
-
+ 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)
+ 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) {
+ return Task.Run (async delegate {
+ 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;
- 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);
+ 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);
+ lock (addLock) {
+ if (!added) {
+ added = true;
+ OnSolutionAdded (solutionInfo);
+ }
}
- }
- return solutionInfo;
+ return solutionInfo;
+ });
}
public Task<SolutionInfo> TryLoadSolution (MonoDevelop.Projects.Solution solution, CancellationToken cancellationToken = default(CancellationToken))
@@ -381,7 +380,7 @@ namespace MonoDevelop.Ide.TypeSystem
project.Modified -= OnProjectModified;
}
- Task<ProjectInfo> LoadProject (MonoDevelop.Projects.DotNetProject p, CancellationToken token)
+ async Task<ProjectInfo> LoadProject (MonoDevelop.Projects.DotNetProject p, CancellationToken token)
{
if (!projectIdMap.ContainsKey (p)) {
p.FileAddedToProject += OnFileAdded;
@@ -392,41 +391,43 @@ namespace MonoDevelop.Ide.TypeSystem
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);
+ 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;
}
internal void UpdateProjectionEntry (MonoDevelop.Projects.ProjectFile projectFile, IReadOnlyList<Projection> projections)
{
+ if (projectFile == null)
+ throw new ArgumentNullException (nameof (projectFile));
+ if (projections == null)
+ throw new ArgumentNullException (nameof (projections));
foreach (var entry in projectionList) {
if (entry.File.FilePath == projectFile.FilePath) {
projectionList.Remove (entry);
@@ -536,14 +537,14 @@ namespace MonoDevelop.Ide.TypeSystem
var hashSet = new HashSet<string> (FilePath.PathComparer);
try {
- foreach (string file in await netProject.GetReferencedAssemblies (configurationSelector, false).ConfigureAwait (false)) {
+ foreach (var 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);
+ if (!Path.IsPathRooted (file.FilePath)) {
+ fileName = Path.Combine (Path.GetDirectoryName (netProject.FileName), file.FilePath);
} else {
- fileName = Path.GetFullPath (file);
+ fileName = file.FilePath.FullPath;
}
if (hashSet.Contains (fileName))
continue;
@@ -555,6 +556,8 @@ namespace MonoDevelop.Ide.TypeSystem
var metadataReference = MetadataReferenceCache.LoadReference (projectId, fileName);
if (metadataReference == null)
continue;
+ if (file.Aliases != null)
+ metadataReference = metadataReference.WithAliases (file.EnumerateAliases ());
result.Add (metadataReference);
}
} catch (Exception e) {
@@ -701,7 +704,7 @@ namespace MonoDevelop.Ide.TypeSystem
Projection projection = null;
foreach (var entry in ProjectionList) {
- var p = entry.Projections.FirstOrDefault (proj => FilePath.PathComparer.Equals (proj.Document.FileName, filePath));
+ var p = entry.Projections.FirstOrDefault (proj => proj?.Document?.FileName != null && FilePath.PathComparer.Equals (proj.Document.FileName, filePath));
if (p != null) {
filePath = entry.File.FilePath;
projection = p;
@@ -1080,6 +1083,8 @@ namespace MonoDevelop.Ide.TypeSystem
continue;
var projectData = GetProjectData (GetProjectId (project));
if (TypeSystemParserNode.IsCompileBuildAction (projectFile.BuildAction)) {
+ if (projectData.GetDocumentId (projectFile.FilePath) != null) // may already been added by a rename event.
+ return;
var newDocument = CreateDocumentInfo (solutionData, project.Name, projectData, projectFile);
OnDocumentAdded (newDocument);
} else {
@@ -1182,6 +1187,7 @@ namespace MonoDevelop.Ide.TypeSystem
var projectId = GetProjectId (project);
if (CurrentSolution.ContainsProject (projectId)) {
OnProjectReloaded (await LoadProject (project, default(CancellationToken)).ConfigureAwait (false));
+ ProjectReloaded?.Invoke (this, new RoslynProjectEventArgs (projectId));
} else {
modifiedProjects.Add (project);
}
@@ -1190,6 +1196,8 @@ namespace MonoDevelop.Ide.TypeSystem
#endregion
+ public event EventHandler<RoslynProjectEventArgs> ProjectReloaded;
+
/// <summary>
/// Tries the get original file from projection. If the fileName / offset is inside a projection this method tries to convert it
@@ -1211,43 +1219,54 @@ namespace MonoDevelop.Ide.TypeSystem
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);
-// }
-// }
-// }
+ // 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 class RoslynProjectEventArgs : EventArgs
+ {
+ public ProjectId ProjectId { get; private set; }
+
+ public RoslynProjectEventArgs (ProjectId projectId)
+ {
+ ProjectId = projectId;
+ }
+ }
}
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 0731b4889a..323b4c8520 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
@@ -258,11 +258,14 @@ namespace MonoDevelop.Ide.TypeSystem
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));
+ var projectFile = options.Project.GetProjectFile (options.FileName);
+ if (projectFile != null) {
+ ws.UpdateProjectionEntry (projectFile, 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));
+ }
}
}
}
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 2546316bab..6e7c337024 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs
@@ -78,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;
@@ -106,7 +106,7 @@ namespace MonoDevelop.Ide.Updater
if (t != null && t.IsCompleted) {
AggregatedProgressMonitor monitor = new AggregatedProgressMonitor (Instance.updateMonitor);
- monitor.AddSlaveMonitor (new MessageDialogProgressMonitor (true, true, false));
+ monitor.AddFollowerMonitor (new MessageDialogProgressMonitor (true, true, false));
await t;
}
HideAlert ();
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 d2cbd3b799..bf991549ac 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs
@@ -119,7 +119,7 @@ namespace MonoDevelop.Ide.WelcomePage
var padColor = Gui.Styles.PadBackground.ToHexString (false);
var hoverColor = Gui.Styles.DockBarPrelightColor.ToHexString (false);
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light) {
BackgroundColor = bgColor;
InnerShadowColor = bgColor;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
index bf80f8ed30..b8d4233ac3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
@@ -7814,8 +7814,6 @@
<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\DefaultCodeFormatter.cs" />
<Compile Include="MonoDevelop.Ide.CodeFormatting\CodeFormatterExtensionNode.cs" />
<Compile Include="MonoDevelop.Ide.Projects\NewPolicySetDialog.cs" />
@@ -8207,7 +8205,6 @@
<Compile Include="MonoDevelop.Ide\TaskUtil.cs" />
<Compile Include="MonoDevelop.Ide.Projects.OptionPanels\CodeAnalysisPanel.cs" />
<Compile Include="MonoDevelop.Ide.CodeCompletion\ICompletionKeyHandler.cs" />
- <Compile Include="MonoDevelop.Components.MainToolbar\FirstCategory.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\NR5CompatibiltyExtensions.cs" />
<Compile Include="MonoDevelop.Ide.Projects\ProjectConfigurationControl.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopProjectCacheHostServiceFactory.cs" />
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
index b7138efba9..d7af2aa4d1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
@@ -72,11 +72,15 @@ namespace MonoDevelop.Ide
static EventHandler initializedEvent;
public static event EventHandler Initialized {
add {
- if (isInitialized) value (null, EventArgs.Empty);
- else initializedEvent += value;
+ Runtime.RunInMainThread (() => {
+ if (isInitialized) value (null, EventArgs.Empty);
+ else initializedEvent += value;
+ });
}
- remove {
- initializedEvent -= value;
+ remove {
+ Runtime.RunInMainThread (() => {
+ initializedEvent -= value;
+ });
}
}
@@ -194,12 +198,17 @@ namespace MonoDevelop.Ide
FileService.ErrorHandler = FileServiceErrorHandler;
- monitor.BeginTask (GettextCatalog.GetString("Loading Workbench"), 5);
+ monitor.BeginTask (GettextCatalog.GetString("Loading Workbench"), 6);
Counters.Initialization.Trace ("Loading Commands");
commandService.LoadCommands ("/MonoDevelop/Ide/Commands");
monitor.Step (1);
+ // Before startup commands.
+ Counters.Initialization.Trace ("Running Pre-Startup Commands");
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Ide/PreStartupHandlers", OnExtensionChanged);
+ monitor.Step (1);
+
Counters.Initialization.Trace ("Initializing Workbench");
workbench.Initialize (monitor);
monitor.Step (1);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs
index eabc788711..ea3a74caac 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs
@@ -113,7 +113,7 @@ namespace MonoDevelop.Ide
}
public readonly ConfigurationProperty<string> UserInterfaceLanguage = Runtime.Preferences.UserInterfaceLanguage;
- public readonly ConfigurationProperty<string> UserInterfaceTheme = ConfigurationProperty.Create ("MonoDevelop.Ide.UserInterfaceTheme", Platform.IsLinux ? "" : "Light");
+ public readonly ConfigurationProperty<string> UserInterfaceThemeName = 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);
@@ -144,8 +144,8 @@ namespace MonoDevelop.Ide
public readonly ConfigurationProperty<bool> FilterCompletionListByEditorBrowsable = ConfigurationProperty.Create ("FilterCompletionListByEditorBrowsable", true);
public readonly ConfigurationProperty<bool> IncludeEditorBrowsableAdvancedMembers = ConfigurationProperty.Create ("IncludeEditorBrowsableAdvancedMembers", true);
- public Skin UserInterfaceSkin {
- get { return MonoDevelop.Components.IdeTheme.UserInterfaceSkin; }
+ public Theme UserInterfaceTheme {
+ get { return MonoDevelop.Components.IdeTheme.UserInterfaceTheme; }
}
internal static readonly string DefaultLightColorScheme = "Light";
@@ -156,16 +156,16 @@ namespace MonoDevelop.Ide
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 readonly ThemeConfigurationProperty<string> UserTasksHighPrioColor = new ThemeConfigurationProperty<string> ("Monodevelop.UserTasksHighPrioColor", "", "rgb:ffff/ffff/ffff");
+ public readonly ThemeConfigurationProperty<string> UserTasksNormalPrioColor = new ThemeConfigurationProperty<string> ("Monodevelop.UserTasksNormalPrioColor", "", "rgb:ffff/ffff/ffff");
+ public readonly ThemeConfigurationProperty<string> UserTasksLowPrioColor = new ThemeConfigurationProperty<string> ("Monodevelop.UserTasksLowPrioColor", "", "rgb:ffff/ffff/ffff");
- public class SkinConfigurationProperty<T>: ConfigurationProperty<T>
+ public class ThemeConfigurationProperty<T>: ConfigurationProperty<T>
{
readonly ConfigurationProperty<T> lightConfiguration;
readonly ConfigurationProperty<T> darkConfiguration;
- public SkinConfigurationProperty (string propertyName, T defaultLightValue, T defaultDarkValue, string oldName = null)
+ public ThemeConfigurationProperty (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");
@@ -175,12 +175,12 @@ namespace MonoDevelop.Ide
MonoDevelop.Ide.Gui.Styles.Changed += (sender, e) => OnChanged ();
}
- public T ValueForSkin (Skin skin)
+ public T ValueForTheme (Theme theme)
{
- switch (skin) {
- case Skin.Light:
+ switch (theme) {
+ case Theme.Light:
return lightConfiguration.Value;
- case Skin.Dark:
+ case Theme.Dark:
return darkConfiguration.Value;
default:
throw new InvalidOperationException ();
@@ -189,7 +189,7 @@ namespace MonoDevelop.Ide
protected override T OnGetValue ()
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light)
return lightConfiguration;
else
return darkConfiguration;
@@ -197,14 +197,14 @@ namespace MonoDevelop.Ide
protected override bool OnSetValue (T value)
{
- if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ if (IdeApp.Preferences.UserInterfaceTheme == Theme.Light)
return lightConfiguration.Set (value);
else
return darkConfiguration.Set (value);
}
}
- public class SchemeConfigurationProperty: SkinConfigurationProperty<string>
+ public class SchemeConfigurationProperty: ThemeConfigurationProperty<string>
{
public SchemeConfigurationProperty (string propertyName, string defaultLightValue, string defaultDarkValue, string oldName = null)
: base (propertyName, defaultLightValue, defaultDarkValue, oldName)
@@ -231,7 +231,7 @@ namespace MonoDevelop.Ide
PromptForSave,
}
- public enum Skin
+ public enum Theme
{
Light,
Dark
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 1e7d4eb26d..a4c657bc58 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs
@@ -447,7 +447,6 @@ namespace MonoDevelop.Ide
return GetStockIdForImageSpec (addin, filename, iconSize);
}
-
static void AddToAnimatedIconFactory (string stockId, AnimatedIcon aicon)
{
animationFactory [stockId] = aicon;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
index 7cfb100c27..cf5be4ac77 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
@@ -130,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)
{
@@ -581,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) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
index d83390e93f..75eace9b8b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
@@ -246,7 +246,7 @@ namespace MonoDevelop.Ide
{
var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (location.SourceTree.FilePath);
var doc = TextEditorFactory.CreateNewDocument ();
- doc.Text = provider.ReadString ();
+ doc.Text = provider.ReadString ().ReadToEnd ();
int position = location.SourceSpan.Start;
while (position + part.Name.Length < doc.Length) {
if (doc.GetTextAt (position, part.Name.Length) == part.Name)
@@ -269,8 +269,8 @@ namespace MonoDevelop.Ide
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);
+ if (assembly.FilePath.ToString ().IndexOf (metadataDllName, StringComparison.Ordinal) > 0) {
+ fileName = dn.GetAbsoluteChildPath (assembly.FilePath);
break;
}
}
@@ -311,8 +311,11 @@ namespace MonoDevelop.Ide
if (askIfMultipleLocations && locations.Length > 1) {
using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
- foreach (var part in locations)
+ foreach (var part in locations) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
monitor.ReportResult (GetJumpTypePartSearchResult (symbol, part));
+ }
}
return;
}
@@ -331,8 +334,8 @@ namespace MonoDevelop.Ide
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);
+ if (assembly.FilePath.ToString ().IndexOf(metadataDllName, StringComparison.Ordinal) > 0) {
+ fileName = dn.GetAbsoluteChildPath (assembly.FilePath);
break;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
index f197f6408b..3dac774169 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
@@ -362,30 +362,34 @@ namespace MonoDevelop.Ide
internal bool Close (bool saveWorkspacePreferencies, bool closeProjectFiles)
{
if (Items.Count > 0) {
-
- // Request permission for unloading the items
- foreach (WorkspaceItem it in new List<WorkspaceItem> (Items)) {
- if (!RequestItemUnload (it))
- return false;
- }
-
- if (saveWorkspacePreferencies)
- SavePreferences ();
-
- if (closeProjectFiles) {
- foreach (Document doc in IdeApp.Workbench.Documents.ToArray ()) {
- if (!doc.Close ())
+ ITimeTracker timer = Counters.CloseWorkspaceTimer.BeginTiming ();
+ try {
+ // Request permission for unloading the items
+ foreach (WorkspaceItem it in new List<WorkspaceItem> (Items)) {
+ if (!RequestItemUnload (it))
return false;
}
- }
-
- foreach (WorkspaceItem it in new List<WorkspaceItem> (Items)) {
- try {
- Items.Remove (it);
- it.Dispose ();
- } catch (Exception ex) {
- MessageService.ShowError (GettextCatalog.GetString ("Could not close solution '{0}'.", it.Name), ex);
+
+ if (saveWorkspacePreferencies)
+ SavePreferences ();
+
+ if (closeProjectFiles) {
+ foreach (Document doc in IdeApp.Workbench.Documents.ToArray ()) {
+ if (!doc.Close ())
+ return false;
+ }
+ }
+
+ foreach (WorkspaceItem it in new List<WorkspaceItem> (Items)) {
+ try {
+ Items.Remove (it);
+ it.Dispose ();
+ } catch (Exception ex) {
+ MessageService.ShowError (GettextCatalog.GetString ("Could not close solution '{0}'.", it.Name), ex);
+ }
}
+ } finally {
+ timer.End ();
}
}
return true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs
index e96e8b7238..16b966dcc4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs
@@ -55,6 +55,8 @@ namespace MonoDevelop.Ide
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");
+ internal static TimerCounter SaveAllTimer = InstrumentationService.CreateTimerCounter ("Save all documents", "IDE", id:"Ide.Shell.SaveAll");
+ internal static TimerCounter CloseWorkspaceTimer = InstrumentationService.CreateTimerCounter ("Workspace closed", "IDE", id:"Ide.Shell.CloseWorkspace");
internal static class ParserService {
public static TimerCounter FileParsed = InstrumentationService.CreateTimerCounter ("File parsed", "Parser Service");
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 72d0eab144..d94b791c2a 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
@@ -64,32 +64,42 @@ namespace MonoDevelop.Projects.MSBuild
/// 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;
+ lock (flushLogLock)
+ lock (log) {
+ if (currentLogWriter != null) {
+ try {
+ flushTimer.Dispose ();
+ FlushLog ();
+ } catch {
+ // Ignoree
+ } finally {
+ // This needs to be done inside the finally, to make sure it is called even in
+ // the case the thread is being aborted.
+ flushTimer = null;
+ currentLogWriter = null;
+ }
+ }
}
}
void LogWriteLine (string txt)
{
- if (currentLogWriter != null) {
- lock (log) {
+ lock (log) {
+ if (currentLogWriter != null) {
// Append the line to the log, and schedule the flush of the log, unless it has already been done
log.AppendLine (txt);
if (!flushingLog) {
diff --git a/main/src/core/MonoDevelop.Startup/app.manifest b/main/src/core/MonoDevelop.Startup/app.manifest
index 9eccbecb2f..0f673db392 100644
--- a/main/src/core/MonoDevelop.Startup/app.manifest
+++ b/main/src/core/MonoDevelop.Startup/app.manifest
@@ -44,11 +44,9 @@
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>
- -->
</assembly>