From d2b65f5aaa39aa4275062a887fe16da078020c94 Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Tue, 4 Dec 2018 09:56:11 -0500 Subject: [PATCH] Revert "Bring in current WIP" --- CONTRIBUTING.md | 22 +- README.md | 4 +- Rubberduck.API/Rubberduck.API.csproj | 2 +- Rubberduck.API/VBA/Parser.cs | 24 +- .../Inspections/Abstract/QuickFixBase.cs | 7 +- .../Concrete/AssignmentNotUsedInspection.cs | 6 +- ...elUdfNameIsValidCellReferenceInspection.cs | 49 -- .../FunctionReturnValueNotUsedInspection.cs | 3 +- .../Concrete/IllegalAnnotationInspection.cs | 69 +- .../NonReturningFunctionInspection.cs | 15 +- .../SheetAccessedUsingStringInspection.cs | 2 +- .../UnassignedVariableUsageInspection.cs | 26 +- .../Concrete/VariableNotAssignedInspection.cs | 15 +- .../VariableRequiresSetAssignmentEvaluator.cs | 28 +- .../Inspections/Inspector.cs | 15 +- .../AccessSheetUsingCodeNameQuickFix.cs | 19 +- .../AddIdentifierToWhiteListQuickFix.cs | 4 +- .../QuickFixes/AddStepOneQuickFix.cs | 25 +- .../ApplicationWorksheetFunctionQuickFix.cs | 14 +- ...gnedByValParameterMakeLocalCopyQuickFix.cs | 14 +- .../QuickFixes/ChangeDimToPrivateQuickFix.cs | 14 +- .../QuickFixes/ChangeIntegerToLongQuickFix.cs | 28 +- .../ChangeProcedureToFunctionQuickFix.cs | 26 +- .../QuickFixes/ConvertToProcedureQuickFix.cs | 26 +- .../DeclareAsExplicitVariantQuickFix.cs | 14 +- .../QuickFixes/EncapsulateFieldQuickFix.cs | 10 +- .../QuickFixes/IgnoreOnceQuickFix.cs | 158 ++-- .../IntroduceLocalVariableQuickFix.cs | 15 +- ...sMissingOnInappropriateArgumentQuickFix.cs | 15 +- .../MakeSingleLineParameterQuickFix.cs | 14 +- .../MoveFieldCloserToUsageQuickFix.cs | 16 +- .../QuickFixes/OptionExplicitQuickFix.cs | 14 +- .../PassParameterByReferenceQuickFix.cs | 14 +- .../PassParameterByValueQuickFix.cs | 27 +- .../QuickFixes/QuickFixProvider.cs | 87 +- .../QuickFixes/RemoveCommentQuickFix.cs | 14 +- .../RemoveDuplicatedAnnotationQuickFix.cs | 18 +- .../RemoveEmptyElseBlockQuickFix.cs | 18 +- .../QuickFixes/RemoveEmptyIfBlockQuickFix.cs | 58 +- .../RemoveExplicitByRefModifierQuickFix.cs | 20 +- ... => RemoveExplicitCallStatmentQuickFix.cs} | 16 +- .../RemoveExplicitLetStatementQuickFix.cs | 14 +- .../QuickFixes/RemoveLocalErrorQuickFix.cs | 14 +- .../RemoveOptionBaseStatementQuickFix.cs | 14 +- .../QuickFixes/RemoveStepOneQuickFix.cs | 15 +- .../QuickFixes/RemoveStopKeywordQuickFix.cs | 14 +- .../QuickFixes/RemoveTypeHintsQuickFix.cs | 16 +- .../RemoveUnassignedIdentifierQuickFix.cs | 14 +- .../RemoveUnassignedVariableUsageQuickFix.cs | 14 +- .../RemoveUnusedDeclarationQuickFix.cs | 14 +- .../RemoveUnusedParameterQuickFix.cs | 20 +- .../QuickFixes/RenameDeclarationQuickFix.cs | 17 +- ...laceEmptyStringLiteralStatementQuickFix.cs | 14 +- .../ReplaceGlobalModifierQuickFix.cs | 14 +- ...eIfElseWithConditionalStatementQuickFix.cs | 15 +- .../ReplaceObsoleteCommentMarkerQuickFix.cs | 14 +- .../ReplaceObsoleteErrorStatementQuickFix.cs | 14 +- .../RestoreErrorHandlingQuickFix.cs | 15 +- .../SetExplicitVariantReturnTypeQuickFix.cs | 14 +- .../SpecifyExplicitByRefModifierQuickFix.cs | 20 +- .../SpecifyExplicitPublicModifierQuickFix.cs | 14 +- .../SplitMultipleDeclarationsQuickFix.cs | 33 +- .../UntypedFunctionUsageQuickFix.cs | 14 +- ...seSetKeywordForObjectAssignmentQuickFix.cs | 27 +- .../QuickFixes/WriteOnlyPropertyQuickFix.cs | 16 +- .../Rubberduck.CodeAnalysis.csproj | 2 +- .../AddRemoveReferences/IReferenceInfo.cs | 18 - .../AddRemoveReferences/ReferenceModel.cs | 127 --- .../AddRemoveReferences/ReferenceStatus.cs | 16 - .../RegisteredLibraryFinderService.cs | 100 --- .../RegisteredLibraryInfo.cs | 92 -- Rubberduck.Core/App.cs | 52 +- Rubberduck.Core/AppMenu.cs | 14 - .../Service/AutoCompleteService.cs | 13 - .../Service/SelfClosingPairHandler.cs | 25 +- .../CodeMetrics/CodeMetricsViewModel.cs | 23 +- Rubberduck.Core/Common/ExportFormatter.cs | 395 +++++---- Rubberduck.Core/Common/Hotkeys/Hotkey.cs | 20 +- Rubberduck.Core/Common/Hotkeys/HotkeyInfo.cs | 4 +- Rubberduck.Core/Common/RubberduckHooks.cs | 2 +- Rubberduck.Core/Common/WinAPI/Kernel32.cs | 2 +- .../Common/WindowsOperatingSystem.cs | 3 +- .../CodeExplorerComponentViewModel.cs | 2 + .../CodeExplorer/CodeExplorerItemViewModel.cs | 16 +- .../CodeExplorerProjectViewModel.cs | 10 +- .../CodeExplorerReferenceFolderViewModel.cs | 45 - .../CodeExplorerReferenceViewModel.cs | 40 - .../CodeExplorer/CodeExplorerViewModel.cs | 31 +- .../Properties/Settings.Designer.cs | 589 +++++++------ Rubberduck.Core/Properties/Settings.settings | 493 ++++++----- Rubberduck.Core/Rubberduck.Core.csproj | 54 +- Rubberduck.Core/Settings/GeneralSettings.cs | 14 +- Rubberduck.Core/Templates/ITemplate.cs | 12 - Rubberduck.Core/Templates/Template.cs | 69 -- .../Templates/TemplateFileHandler.cs | 74 -- Rubberduck.Core/Templates/TemplateProvider.cs | 62 -- .../AddRemoveReferencesDialog.Designer.cs | 67 -- .../AddRemoveReferencesDialog.cs | 21 - .../AddRemoveReferencesDialog.resx | 145 ---- .../AddRemoveReferencesModel.cs | 34 - .../AddRemoveReferencesPresenter.cs | 50 -- .../AddRemoveReferencesPresenterFactory.cs | 110 --- .../AddRemoveReferencesViewModel.cs | 346 -------- .../AddRemoveReferencesWindow.xaml | 369 -------- .../AddRemoveReferencesWindow.xaml.cs | 17 - .../ReferenceStatusImageSourceConverter.cs | 36 - .../UI/CodeExplorer/CodeExplorerControl.xaml | 308 ++++--- .../UI/CodeExplorer/CodeExplorerWindow.cs | 2 +- .../Commands/AddComponentCommand.cs | 69 +- .../Commands/AddMDIFormCommand.cs | 13 +- .../Commands/AddRemoveReferencesCommand.cs | 53 -- .../Commands/AddTemplateCommand.cs | 46 - .../Commands/CopyResultsCommand.cs | 26 +- .../UI/CodeExplorer/Commands/ExportCommand.cs | 14 +- .../UI/CodeExplorer/Commands/ImportCommand.cs | 14 +- .../UI/CodeExplorer/Commands/IndentCommand.cs | 2 +- .../UI/CodeExplorer/Commands/PrintCommand.cs | 24 +- .../UI/CodeExplorer/Commands/RemoveCommand.cs | 14 +- .../UI/CodeExplorer/Commands/RenameCommand.cs | 20 +- .../UI/CodeMetrics/CodeMetricsWindow.cs | 2 +- .../UI/Command/ExportAllCommand.cs | 25 +- .../Command/FindAllImplementationsCommand.cs | 22 +- .../UI/Command/FindAllReferencesCommand.cs | 77 +- .../CommandBars/AppCommandBarBase.cs | 27 +- .../CommandBars/RubberduckCommandBar.cs | 14 - .../ParentMenus/ParentMenuItemBase.cs | 26 +- .../CodePaneRefactorRenameCommand.cs | 9 +- .../FormDesignerRefactorRenameCommand.cs | 7 +- .../ProjectExplorerRefactorRenameCommand.cs | 7 +- .../RefactorEncapsulateFieldCommand.cs | 7 +- .../RefactorExtractInterfaceCommand.cs | 7 +- .../RefactorImplementInterfaceCommand.cs | 7 +- .../RefactorIntroduceFieldCommand.cs | 7 +- .../RefactorIntroduceParameterCommand.cs | 7 +- .../RefactorMoveCloserToUsageCommand.cs | 7 +- .../RefactorRemoveParametersCommand.cs | 7 +- .../RefactorReorderParametersCommand.cs | 7 +- Rubberduck.Core/UI/Command/ReparseCommand.cs | 1 + .../UI/Command/ShowParserErrorsCommand.cs | 13 - .../UI/Controls/NumberPicker.xaml.cs | 55 +- .../UI/Converters/ImageSourceConverter.cs | 33 - .../UI/Converters/RemainingWidthConverter.cs | 26 - ...emplateCommandParameterToTupleConverter.cs | 24 - .../UI/CustomComWrappers/IOleWrapper.cs | 86 +- .../UI/DockableToolwindowPresenter.cs | 12 +- Rubberduck.Core/UI/FolderBrowser.cs | 13 - .../{OpenFileDialog.cs => IOpenFileDialog.cs} | 13 - .../{SaveFileDialog.cs => ISaveFileDialog.cs} | 13 - .../Inspections/AggregateInspectionResult.cs | 2 +- .../Inspections/InspectionResultsViewModel.cs | 2 +- .../UI/Inspections/InspectionResultsWindow.cs | 2 +- Rubberduck.Core/UI/ModernFolderBrowser.cs | 15 +- .../EncapsulateFieldPresenter.cs | 6 +- .../ExtractInterfaceView.xaml | 32 +- .../InterfaceMemberViewModel.cs | 14 +- Rubberduck.Core/UI/SelectionChangeService.cs | 13 - .../UI/Settings/AutoCompleteSettings.xaml | 23 +- .../Settings/AutoCompleteSettingsViewModel.cs | 16 +- Rubberduck.Core/UI/Settings/Settings.cs | 13 - Rubberduck.Core/UI/SimpleListControl.cs | 2 +- Rubberduck.Core/UI/Splash.Designer.cs | 3 +- Rubberduck.Core/UI/Splash.cs | 4 +- Rubberduck.Core/UI/Splash.resx | 4 - .../UI/ToDoItems/ToDoExplorerWindow.cs | 2 +- .../Commands/AddTestModuleCommand.cs | 162 ++-- .../UnitTesting/TestExplorerControl.xaml.cs | 14 +- .../UI/UnitTesting/TestExplorerViewModel.cs | 20 +- Rubberduck.Core/app.config | 399 +++++++++ Rubberduck.Deployment/BuildRegistryScript.ps1 | 26 +- .../IdlGeneration/IdlGenerator.cs | 3 - .../Rubberduck.Deployment.csproj | 10 +- .../Rubberduck.Interaction.csproj | 2 +- .../ComClientLibrary/UI/DockableWindowHost.cs | 3 - .../Root/RubberduckIoCInstaller.cs | 19 +- Rubberduck.Main/Rubberduck.Main.csproj | 2 +- Rubberduck.Main/VbeProvider.cs | 1 + ...otationService.cs => AnnotationService.cs} | 13 +- .../ComReflection/ComInterface.cs | 2 +- .../ComReflection/XmlComProjectSerializer.cs | 11 +- Rubberduck.Parsing/Grammar/VBAParser.g4 | 6 +- .../Inspections/Abstract/IQuickFix.cs | 5 +- .../Rewriter/AttributesRewriteSession.cs | 47 - .../Rewriter/CodePaneRewriteSession.cs | 37 - .../Rewriter/IExecutableModuleRewriter.cs | 10 - .../Rewriter/IModuleRewriter.cs | 43 +- .../Rewriter/IModuleRewriterFactory.cs | 4 +- .../Rewriter/IRewriteSession.cs | 14 - .../Rewriter/IRewriteSessionFactory.cs | 10 - .../Rewriter/IRewriterProvider.cs | 10 - .../Rewriter/IRewritingManager.cs | 9 - .../Rewriter/ITokenStreamCache.cs | 11 - Rubberduck.Parsing/Rewriter/ModuleRewriter.cs | 34 +- .../Rewriter/ModuleRewriterFactory.cs | 4 +- .../Rewriter/RewriteSessionBase.cs | 88 -- .../Rewriter/RewriteSessionFactory.cs | 27 - .../Rewriter/RewriterProvider.cs | 29 - .../Rewriter/RewritingManager.cs | 94 -- .../Rewriter/StateTokenStreamCache.cs | 27 - Rubberduck.Parsing/Rubberduck.Parsing.csproj | 4 +- .../Symbols/IdentifierReferenceResolver.cs | 14 +- Rubberduck.Parsing/VBA/AccessibilityCheck.cs | 16 +- .../DeclarationCaching/DeclarationFinder.cs | 84 +- .../DeclarationResolveRunnerBase.cs | 46 +- .../DeclarationSymbolsListener.cs | 61 +- Rubberduck.Parsing/VBA/IParseManager.cs | 14 - Rubberduck.Parsing/VBA/ModuleState.cs | 14 +- Rubberduck.Parsing/VBA/ParseCoordinator.cs | 22 +- .../VBA/Parsing/IModuleParser.cs | 12 +- .../VBA/Parsing/ModuleParser.cs | 11 +- .../VBA/Parsing/ParseRunnerBase.cs | 8 +- .../BoundExpressionVisitor.cs | 14 +- .../VBA/RubberduckParserState.cs | 55 +- .../VBA/StateProjectManagerBase.cs | 2 +- .../VBA/SynchronousParseCoordinator.cs | 18 +- .../EncapsulateFieldRefactoring.cs | 38 +- .../ExtractInterfaceRefactoring.cs | 36 +- .../ImplementInterfaceRefactoring.cs | 11 +- .../IntroduceFieldRefactoring.cs | 20 +- .../IntroduceParameterRefactoring.cs | 45 +- .../MoveCloserToUsageRefactoring.cs | 47 +- .../RemoveParametersRefactoring.cs | 54 +- .../Rename/RenameRefactoring.cs | 175 ++-- .../ReorderParametersRefactoring.cs | 69 +- .../Rubberduck.Refactorings.csproj | 2 +- .../Rubberduck.RegexAssistant.csproj | 2 +- .../i18n/AssistantResources.fr.resx | 120 --- Rubberduck.Resources/About/AboutUI.de.resx | 23 +- Rubberduck.Resources/About/AboutUI.fr.resx | 11 +- .../CodeExplorer/CodeExplorerUI.Designer.cs | 57 +- .../CodeExplorer/CodeExplorerUI.de.resx | 30 - .../CodeExplorer/CodeExplorerUI.fr.resx | 30 - .../CodeExplorer/CodeExplorerUI.resx | 85 +- Rubberduck.Resources/CommandBarIcons.resx | 52 +- .../Icons/Custom/PNG/BrokenReference.png | Bin 713 -> 0 bytes .../Icons/Custom/PNG/LockedReference.png | Bin 803 -> 0 bytes .../Icons/Fugue/arrow-180.png | Bin 589 -> 0 bytes .../Icons/Fugue/clock-select-pinned.png | Bin 860 -> 0 bytes .../Icons/Fugue/clock-select.png | Bin 741 -> 0 bytes .../Icons/Fugue/exclamation-pinned.png | Bin 743 -> 0 bytes .../Icons/Fugue/lock-pinned.png | Bin 729 -> 0 bytes Rubberduck.Resources/Icons/Fugue/lock.png | Bin 1535 -> 0 bytes .../Icons/Fugue/node-select-all.png | Bin 563 -> 0 bytes Rubberduck.Resources/Icons/Fugue/pinned.png | Bin 581 -> 0 bytes .../Icons/Fugue/plus-circle-pinned.png | Bin 826 -> 0 bytes .../Icons/Fugue/tick-circle-pinned.png | Bin 832 -> 0 bytes .../Inspections/InspectionInfo.Designer.cs | 9 - .../Inspections/InspectionInfo.cs.resx | 3 + .../Inspections/InspectionInfo.de.resx | 36 +- .../Inspections/InspectionInfo.fr.resx | 36 +- .../Inspections/InspectionInfo.resx | 7 +- .../Inspections/InspectionNames.Designer.cs | 9 - .../Inspections/InspectionNames.cs.resx | 3 + .../Inspections/InspectionNames.de.resx | 36 +- .../Inspections/InspectionNames.fr.resx | 36 +- .../Inspections/InspectionNames.resx | 5 +- .../Inspections/InspectionResults.Designer.cs | 9 - .../Inspections/InspectionResults.cs.resx | 6 + .../Inspections/InspectionResults.de.resx | 45 +- .../Inspections/InspectionResults.fr.resx | 42 +- .../Inspections/InspectionResults.resx | 4 - .../Inspections/InspectionsUI.de.resx | 3 - .../Inspections/InspectionsUI.fr.resx | 3 - .../Inspections/InspectionsUI.resx | 8 +- .../Inspections/QuickFixes.de.resx | 15 - .../Inspections/QuickFixes.fr.resx | 15 - .../Rubberduck.Resources.csproj | 52 +- Rubberduck.Resources/RubberduckUI.Designer.cs | 311 +------ Rubberduck.Resources/RubberduckUI.cs.resx | 51 ++ Rubberduck.Resources/RubberduckUI.de.resx | 183 ++-- Rubberduck.Resources/RubberduckUI.fr.resx | 201 ++++- Rubberduck.Resources/RubberduckUI.resx | 114 +-- .../Settings/AutoCompletesPage.Designer.cs | 9 - .../Settings/AutoCompletesPage.cs.resx | 57 ++ .../Settings/AutoCompletesPage.de.resx | 79 +- .../Settings/AutoCompletesPage.fr.resx | 79 +- .../Settings/AutoCompletesPage.resx | 3 - .../Settings/SettingsUI.de.resx | 6 - .../Settings/SettingsUI.fr.resx | 12 +- .../Settings/ToDoExplorerPage.cs.resx | 3 + .../Settings/ToDoExplorerPage.de.resx | 3 + .../Settings/ToDoExplorerPage.fr.resx | 3 + .../Settings/ToDoExplorerPage.resx | 3 + Rubberduck.Resources/Templates.Designer.cs | 109 --- Rubberduck.Resources/Templates.resx | 142 ---- .../ToDoExplorer/ToDoExplorerUI.cs.resx | 6 + .../ToDoExplorer/ToDoExplorerUI.de.resx | 6 + .../ToDoExplorer/ToDoExplorerUI.fr.resx | 6 + .../ToDoExplorer/ToDoExplorerUI.resx | 6 + .../UnitTesting/AssertMessages.cs.resx | 6 + .../UnitTesting/AssertMessages.de.resx | 24 +- .../UnitTesting/AssertMessages.fr.resx | 24 +- .../UnitTesting/TestExplorer.cs.resx | 2 +- .../UnitTesting/TestExplorer.de.resx | 9 - .../UnitTesting/TestExplorer.fr.resx | 9 - .../UnitTesting/TestExplorer.resx | 2 +- .../IPersistancePathProvider.cs | 8 - .../PersistancePathProvider.cs | 17 - .../Rubberduck.SettingsProvider.csproj | 2 +- .../XmlPersistanceService.cs | 2 - .../Rubberduck.SmartIndenter.csproj | 2 +- .../PermissiveObjectComparer.cs | 1 - .../Rubberduck.UnitTesting.csproj | 2 +- .../UnitTesting/VBEInteraction.cs | 58 +- .../ComManagement/ComSafeBase.cs | 2 +- .../ComManagement/ProjectsRepository.cs | 10 +- .../ComManagement/TypeLibs/TypeInfos.cs | 47 +- .../ComManagement/TypeLibs/TypeLibs.cs | 38 +- .../ComManagement/TypeLibs/TypeLibsSupport.cs | 48 +- .../Events/KeyPressEventArgs.cs | 5 +- .../Rubberduck.VBEditor.csproj | 2 +- .../Abstract/HostApplicationBase.cs | 2 - .../SafeComWrappers/ComWrapperEnumerator.cs | 2 +- .../CodePaneSourceCodeHandler.cs | 39 +- .../Settings/IVBESettings.cs | 0 .../Settings/VBESettings.cs | 26 +- .../VBEDllVersion.cs | 6 +- .../VbeRuntime/Vb6NativeApi.cs | 100 --- .../VbeRuntime/VbeNativeApiAccessor.cs | 23 +- Rubberduck.VBEEditor/WindowsApi/User32.cs | 18 +- .../Rubberduck.VBEditor.VB6.csproj | 2 +- .../SafeComWrappers/Office/CommandBar.cs | 4 +- .../Office/CommandBarButton.cs | 4 +- .../Office/CommandBarControl.cs | 2 - .../Office/CommandBarControls.cs | 4 +- .../SafeComWrappers/Office/CommandBarPopup.cs | 2 - .../SafeComWrappers/Office/CommandBars.cs | 2 - .../SafeComWrappers/VB/AddIn.cs | 2 - .../SafeComWrappers/VB/AddIns.cs | 4 +- .../SafeComWrappers/VB/Application.cs | 2 - .../SafeComWrappers/VB/CodeModule.cs | 17 +- .../SafeComWrappers/VB/CodePane.cs | 27 +- .../SafeComWrappers/VB/CodePanes.cs | 4 +- .../VB/CommandBarButtonEvents.cs | 4 +- .../SafeComWrappers/VB/CommandBarEvents.cs | 2 - .../SafeComWrappers/VB/Events.cs | 2 - .../SafeComWrappers/VB/LinkedWindows.cs | 4 +- .../SafeComWrappers/VB/Properties.cs | 4 +- .../SafeComWrappers/VB/Property.cs | 2 - .../SafeComWrappers/VB/Reference.cs | 2 - .../SafeComWrappers/VB/References.cs | 4 +- .../SafeComWrappers/VB/SelectedVBControls.cs | 4 +- .../SafeComWrappers/VB/VBComponent.cs | 2 - .../SafeComWrappers/VB/VBComponents.cs | 5 +- .../SafeComWrappers/VB/VBControl.cs | 2 - .../SafeComWrappers/VB/VBControls.cs | 4 +- .../SafeComWrappers/VB/VBE.cs | 2 - .../SafeComWrappers/VB/VBForm.cs | 2 - .../SafeComWrappers/VB/VBProject.cs | 16 +- .../SafeComWrappers/VB/VBProjects.cs | 31 +- .../SafeComWrappers/VB/Window.cs | 2 - .../SafeComWrappers/VB/Windows.cs | 4 +- .../Rubberduck.VBEditor.VBA.csproj | 2 +- .../Application/FallbackApp.cs | 1 - .../SafeComWrappers/Office/CommandBar.cs | 2 - .../Office/CommandBarButton.cs | 4 +- .../Office/CommandBarControl.cs | 2 - .../Office/CommandBarControls.cs | 16 +- .../SafeComWrappers/Office/CommandBarPopup.cs | 2 - .../SafeComWrappers/Office/CommandBars.cs | 2 - .../SafeComWrappers/VB/AddIn.cs | 2 - .../SafeComWrappers/VB/AddIns.cs | 4 +- .../SafeComWrappers/VB/Application.cs | 2 - .../SafeComWrappers/VB/CodeModule.cs | 17 +- .../SafeComWrappers/VB/CodePane.cs | 27 +- .../SafeComWrappers/VB/CodePanes.cs | 4 +- .../SafeComWrappers/VB/Control.cs | 2 - .../SafeComWrappers/VB/Controls.cs | 4 +- .../SafeComWrappers/VB/LinkedWindows.cs | 4 +- .../SafeComWrappers/VB/Properties.cs | 4 +- .../SafeComWrappers/VB/Property.cs | 2 - .../SafeComWrappers/VB/Reference.cs | 2 - .../SafeComWrappers/VB/References.cs | 4 +- .../SafeComWrappers/VB/UserForm.cs | 2 - .../SafeComWrappers/VB/VBComponent.cs | 2 - .../SafeComWrappers/VB/VBComponents.cs | 4 +- .../SafeComWrappers/VB/VBE.cs | 100 +-- .../SafeComWrappers/VB/VBProject.cs | 22 +- .../SafeComWrappers/VB/VBProjects.cs | 30 +- .../SafeComWrappers/VB/Window.cs | 2 - .../SafeComWrappers/VB/Windows.cs | 4 +- RubberduckBaseProject.csproj | 16 +- .../RubberduckCodeAnalysis.csproj | 2 +- .../Annotations/AnnotationResolutionTests.cs | 256 +----- .../AutoComplete/CodePaneHandlerTests.cs | 14 - .../SelfClosingPairHandlerTests.cs | 11 - .../CodeExplorer/CodeExplorerTests.cs | 423 +++++---- .../Commands/RefactorCommandTests.cs | 512 ++++++----- RubberduckTests/Grammar/VBAParserTests.cs | 14 - .../AssignmentNotUsedInspectionTests.cs | 188 ++-- .../Inspections/EmptyModuleInspectionTests.cs | 2 +- ...NameIsValidCellReferenceInspectionTests.cs | 128 --- ...nctionReturnValueNotUsedInspectionTests.cs | 339 ++++---- .../IllegalAnnotationsInspectionTests.cs | 210 +---- .../NonReturningFunctionInspectionTests.cs | 124 --- .../ObjectVariableNotSetInspectionTests.cs | 5 +- .../UnassignedVariableUsageInspectionTests.cs | 217 ++--- .../UntypedFunctionUsageInspectionTests.cs | 4 +- .../VariableNotAssignedInspectionTests.cs | 25 - RubberduckTests/Mocks/MockParser.cs | 61 +- RubberduckTests/Mocks/MockVbeBuilder.cs | 24 +- RubberduckTests/Mocks/Windows.cs | 12 +- .../PostProcessing/ModuleRewriterTests.cs | 519 ++++++++++-- .../AccessSheetUsingCodeNameQuickFixTests.cs | 142 +++- .../QuickFixes/AddStepOneQuickFixTests.cs | 34 +- ...plicationWorksheetFunctionQuickFixTests.cs | 85 +- ...yValParameterMakeLocalCopyQuickFixTests.cs | 16 +- .../ChangeDimToPrivateQuickFixTests.cs | 53 +- .../ChangeIntegerToLongQuickFixTests.cs | 672 +++++++++++---- .../ChangeProcedureToFunctionQuickFixTests.cs | 104 ++- .../ConvertToProcedureQuickFixTests.cs | 160 ++-- .../DeclareAsExplicitVariantQuickFixTests.cs | 67 +- .../QuickFixes/IgnoreOnceQuickFixTests.cs | 800 +++++++++++------- .../IntroduceLocalVariableQuickFixTests.cs | 41 +- ...ingOnInappropriateArgumentQuickFixTests.cs | 28 +- .../MakeSingleLineParamegerQuickFixTests.cs | 27 +- .../MoveFieldCloserToUsageQuickFixTests.cs | 53 +- .../QuickFixes/OptionExplicitQuickFixTests.cs | 27 +- .../PassParameterByReferenceQuickFixTests.cs | 101 ++- .../PassParameterByValueQuickFixTests.cs | 129 ++- .../QuickFixes/QuickFixBaseTests.cs | 4 +- .../QuickFixes/QuickFixProviderTests.cs | 16 +- .../QuickFixes/QuickFixTestBase.cs | 176 ---- .../QuickFixes/RemoveCommentQuickFixTests.cs | 65 +- ...RemoveDuplicatedAnnotationQuickFixTests.cs | 111 ++- .../RemoveEmptyElseBlockQuickFixTests.cs | 27 +- .../RemoveEmptyIfBlockQuickFixTests.cs | 420 +++++++-- ...emoveExplicitByRefModifierQuickFixTests.cs | 205 +++-- ...emoveExplicitCallStatementQuickFixTests.cs | 29 +- ...RemoveExplicitLetStatementQuickFixTests.cs | 27 +- .../RemoveLocalErrorQuickFixTests.cs | 26 +- .../RemoveOptionBaseStatementQuickFixTests.cs | 83 +- .../QuickFixes/RemoveStepOneQuickFixTests.cs | 28 +- .../RemoveStopKeywordQuickFixTests.cs | 40 +- .../RemoveTypeHintsQuickFixTests.cs | 197 ++++- ...RemoveUnassignedIdentifierQuickFixTests.cs | 59 +- ...oveUnassignedVariableUsageQuickFixTests.cs | 75 +- .../RemoveUnusedDeclarationQuickFixTests.cs | 149 +++- .../RemoveUnusedParameterQuickFixTests.cs | 10 +- ...mptyStringLiteralStatementQuickFixTests.cs | 27 +- .../ReplaceGlobalModifierQuickFixTests.cs | 25 +- ...seWithConditionalStatementQuickFixTests.cs | 64 +- ...placeObsoleteCommentMarkerQuickFixTests.cs | 64 +- ...laceObsoleteErrorStatementQuickFixTests.cs | 64 +- .../RestoreErrorHandlingQuickFixTests.cs | 144 +++- ...tExplicitVariantReturnTypeQuickFixTests.cs | 62 +- ...ecifyExplicitByRefModifierQuickFixTests.cs | 206 +++-- ...cifyExplicitPublicModifierQuickFixTests.cs | 25 +- .../SplitMultipleDeclarationsQuickFixTests.cs | 52 +- .../UntypedFunctionUsageQuickFixTests.cs | 12 +- ...KeywordForObjectAssignmentQuickFixTests.cs | 109 +-- .../WriteOnlyPropertyQuickFixTests.cs | 55 +- .../Refactoring/EncapsulateFieldTests.cs | 162 ++-- .../Refactoring/ExtractInterfaceTests.cs | 35 +- .../Refactoring/ImplementInterfaceTests.cs | 182 ++-- .../Refactoring/IntroduceFieldTests.cs | 119 ++- .../Refactoring/IntroduceParameterTests.cs | 193 ++--- .../Refactoring/MoveCloserToUsageTests.cs | 296 +++---- .../Refactoring/RemoveParametersTests.cs | 166 ++-- RubberduckTests/Refactoring/RenameTests.cs | 149 +--- .../Refactoring/ReorderParametersTests.cs | 186 ++-- .../ArgumentRewriterInfoFinderTests.cs | 32 +- .../Rewriter/AttributesRewriteSessionTests.cs | 98 --- .../Rewriter/CodePaneRewriteSessionTests.cs | 108 --- .../ConstantRewriterInfoFinderTests.cs | 16 +- .../ParameterRewriterInfoFinderTests.cs | 16 +- .../Rewriter/RewriteManagerTests.cs | 228 ----- .../Rewriter/RewriteSessionTestBase.cs | 262 ------ .../VariableRewriterInfoFinderTests.cs | 16 +- RubberduckTests/RubberduckTests.csproj | 2 +- .../Symbols/DeclarationFinderTests.cs | 40 - .../Symbols/VariableDeclarationTests.cs | 59 -- .../Templates/TemplateResourceTests.cs | 133 --- .../RubberduckTestsCodeAnalysis.csproj | 2 +- appveyor.yml | 8 +- 474 files changed, 9376 insertions(+), 12998 deletions(-) delete mode 100644 Rubberduck.CodeAnalysis/Inspections/Concrete/ExcelUdfNameIsValidCellReferenceInspection.cs rename Rubberduck.CodeAnalysis/QuickFixes/{RemoveExplicitCallStatementQuickFix.cs => RemoveExplicitCallStatmentQuickFix.cs} (71%) delete mode 100644 Rubberduck.Core/AddRemoveReferences/IReferenceInfo.cs delete mode 100644 Rubberduck.Core/AddRemoveReferences/ReferenceModel.cs delete mode 100644 Rubberduck.Core/AddRemoveReferences/ReferenceStatus.cs delete mode 100644 Rubberduck.Core/AddRemoveReferences/RegisteredLibraryFinderService.cs delete mode 100644 Rubberduck.Core/AddRemoveReferences/RegisteredLibraryInfo.cs delete mode 100644 Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerReferenceFolderViewModel.cs delete mode 100644 Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerReferenceViewModel.cs delete mode 100644 Rubberduck.Core/Templates/ITemplate.cs delete mode 100644 Rubberduck.Core/Templates/Template.cs delete mode 100644 Rubberduck.Core/Templates/TemplateFileHandler.cs delete mode 100644 Rubberduck.Core/Templates/TemplateProvider.cs delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesDialog.Designer.cs delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesDialog.cs delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesDialog.resx delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesModel.cs delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesPresenter.cs delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesPresenterFactory.cs delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesViewModel.cs delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesWindow.xaml delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesWindow.xaml.cs delete mode 100644 Rubberduck.Core/UI/AddRemoveReferences/ReferenceStatusImageSourceConverter.cs delete mode 100644 Rubberduck.Core/UI/CodeExplorer/Commands/AddRemoveReferencesCommand.cs delete mode 100644 Rubberduck.Core/UI/CodeExplorer/Commands/AddTemplateCommand.cs delete mode 100644 Rubberduck.Core/UI/Converters/ImageSourceConverter.cs delete mode 100644 Rubberduck.Core/UI/Converters/RemainingWidthConverter.cs delete mode 100644 Rubberduck.Core/UI/Converters/TemplateCommandParameterToTupleConverter.cs rename Rubberduck.Core/UI/{OpenFileDialog.cs => IOpenFileDialog.cs} (96%) rename Rubberduck.Core/UI/{SaveFileDialog.cs => ISaveFileDialog.cs} (95%) rename Rubberduck.Parsing/Annotations/{IdentifierAnnotationService.cs => AnnotationService.cs} (64%) delete mode 100644 Rubberduck.Parsing/Rewriter/AttributesRewriteSession.cs delete mode 100644 Rubberduck.Parsing/Rewriter/CodePaneRewriteSession.cs delete mode 100644 Rubberduck.Parsing/Rewriter/IExecutableModuleRewriter.cs delete mode 100644 Rubberduck.Parsing/Rewriter/IRewriteSession.cs delete mode 100644 Rubberduck.Parsing/Rewriter/IRewriteSessionFactory.cs delete mode 100644 Rubberduck.Parsing/Rewriter/IRewriterProvider.cs delete mode 100644 Rubberduck.Parsing/Rewriter/IRewritingManager.cs delete mode 100644 Rubberduck.Parsing/Rewriter/ITokenStreamCache.cs delete mode 100644 Rubberduck.Parsing/Rewriter/RewriteSessionBase.cs delete mode 100644 Rubberduck.Parsing/Rewriter/RewriteSessionFactory.cs delete mode 100644 Rubberduck.Parsing/Rewriter/RewriterProvider.cs delete mode 100644 Rubberduck.Parsing/Rewriter/RewritingManager.cs delete mode 100644 Rubberduck.Parsing/Rewriter/StateTokenStreamCache.cs delete mode 100644 Rubberduck.Parsing/VBA/IParseManager.cs delete mode 100644 Rubberduck.RegexAssistant/i18n/AssistantResources.fr.resx delete mode 100644 Rubberduck.Resources/Icons/Custom/PNG/BrokenReference.png delete mode 100644 Rubberduck.Resources/Icons/Custom/PNG/LockedReference.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/arrow-180.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/clock-select-pinned.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/clock-select.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/exclamation-pinned.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/lock-pinned.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/lock.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/node-select-all.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/pinned.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/plus-circle-pinned.png delete mode 100644 Rubberduck.Resources/Icons/Fugue/tick-circle-pinned.png delete mode 100644 Rubberduck.Resources/Templates.Designer.cs delete mode 100644 Rubberduck.Resources/Templates.resx delete mode 100644 Rubberduck.SettingsProvider/IPersistancePathProvider.cs delete mode 100644 Rubberduck.SettingsProvider/PersistancePathProvider.cs rename Rubberduck.VBEEditor/{VbeRuntime => VBERuntime}/Settings/IVBESettings.cs (100%) rename Rubberduck.VBEEditor/{VbeRuntime => VBERuntime}/Settings/VBESettings.cs (72%) rename Rubberduck.VBEEditor/{VbeRuntime => VBERuntime}/VBEDllVersion.cs (76%) delete mode 100644 Rubberduck.VBEEditor/VbeRuntime/Vb6NativeApi.cs delete mode 100644 RubberduckTests/Inspections/ExcelUdfNameIsValidCellReferenceInspectionTests.cs delete mode 100644 RubberduckTests/QuickFixes/QuickFixTestBase.cs delete mode 100644 RubberduckTests/Rewriter/AttributesRewriteSessionTests.cs delete mode 100644 RubberduckTests/Rewriter/CodePaneRewriteSessionTests.cs delete mode 100644 RubberduckTests/Rewriter/RewriteManagerTests.cs delete mode 100644 RubberduckTests/Rewriter/RewriteSessionTestBase.cs delete mode 100644 RubberduckTests/Symbols/VariableDeclarationTests.cs delete mode 100644 RubberduckTests/Templates/TemplateResourceTests.cs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 86dc22dfd3..ce308d0dfa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,15 +61,15 @@ Our Ducky has come quite the long way and is intimidatingly large for a first-ti To make it easier to find something you can do, all issues with that label are additionally labelled with a difficulty. That difficulty level is a best-guess by the dev-team how complex or evil an issue will be. -If you're new to C#, we recommend you start with \[difficulty-01-duckling\]. The next step \[difficulty-02-ducky\] requires some knowledge about C#, but not so much about how Rubberduck works - 02/ducky issues usually make a good introduction to using Rubberduck's internal API. +If you're new to C#, we recommend you start with \[difficulty-01-duckling\]. The next step \[difficulty-02-ducky\] requires some knowledge about C#, but not so much about how Rubberduck works -Then there's \[difficulty-03-duck\] which requires a good handle on C# and how the components of Rubberduck play toghether. +Then there's \[difficulty-03-duck\] which requires a good handle on C# and at least an idea of how the components of Rubberduck play toghether. And finally there's \[difficulty-04-quackhead\] for when you really want to bang your head against the wall. -They require both good knowledge of C# and a deep understanding of how not only Rubberduck, but also COM and well, the VBE, works. +They require both good knowledge of C# and a deep understanding of how Rubberduck works. In addition to this, a few people have put together some helpful resources about how Rubberduck works internally and help contributors tell left from right in the ~250k Lines of Code. -You can find their work in the [GitHub wiki](https://github.com/rubberduck-vba/Rubberduck/wiki). If something in there doesn't quite seem to match, it's probably because nobody got around to updating it yet. You're very welcome to **improve** the wiki by adding and correcting information. (see right above) +You can find their work in the [github wiki](https://github.com/rubberduck-vba/Rubberduck/wiki). If something in there doesn't quite seem to match, it's probably because nobody got around to updating it yet. You're very welcome to **improve** the wiki by adding and correcting information. (see right above) In case this doesn't quite help you or the information you need hasn't been added to the wiki, you can **always** ask questions. Please do so in the ["War room"](https://chat.stackexchange.com/rooms/14929). @@ -79,21 +79,21 @@ Other than that, you can also open an issue with the label \[support\], but it m In that room the core team talks about the duck and whatever else comes up. N.B.: The rules of the Stack Exchange Network apply to everything you say in that room. But basically those are the same rules as those in the [CoC](#Code_of_Conduct). -Whether you create an issue or a pull request, please avoid using `[` square brackets `]` in the title, and try to be as descriptive (but succinct) as possible. Square brackets in titles confuse our chat-bot, and end up rendering in weird broken ways in SE chat. Avoid riddles, bad puns and other would-be funny (or NSFW) titles that don't really *describe the issue or PR*. +Whether you create an issue or a pull request, please avoid using `[` square brackets `]` in the title, and try to be as descriptive (but succinct) as possible. Square brackets in titles confuse our chat-bot, and end up rendering in weird broken ways in SE chat. Avoid riddles, bad puns and other would-be funny (or NSFW) titles that don't really describe the issue or PR. ### Translations -Rubberduck is localized in multiple languages. +Rubberduck is Localized in multiple languages. All these translations have been provided by volunteers. We welcome both new translations as well as improvements to current translations very much. -The resource files are RESX/XML files easily editable in any text editor, but our recommendation goes to the [ResXManager](https://marketplace.visualstudio.com/items?itemName=TomEnglert.ResXManager) Visual Studio plug-in: +The resource files are RESX/XML files easily editable in any text editor, but comparing resource keys across languages/translations is much easier done with @Vogel612's [Translation Helper](https://github.com/Vogel612/TranslationHelper) tool, which automatically adds missing keys and highlights entries that need a new translation. -![ResXManager in Visual Studio](https://user-images.githubusercontent.com/5751684/48683625-1a07f000-eb7c-11e8-914a-10ed80e85e29.png) - -If you contribute a translation for a brand new previously unsupported language, please keep in touch with the dev team so that new resource keys can be translated when a new release is coming up; abandoned languages/translations will end up getting dropped. +If you contribute a translation for a brand new previously unsupported language, keep in touch with the dev team so that new resource keys can be translated when a new release is coming up; abandoned languages/translations will end up getting dropped. ## What comes out of it for me? -Well... the eternal gratitude of all Rubberduck users for one :wink: +Well ... the eternal gratitude of all Rubberduck users for one :wink: Aside from that, all contributors are explicitly listed by name (or alias) in the "About Rubberduck" window. + +We ran a [fundraiser](https://gofundme.com/rubberduckvba) last summer, and had t-sihrts, mugs, pens, and stickers made - the goods are now unfortunately depleted; we'll probably run another campaign next year! diff --git a/README.md b/README.md index 51e6a74056..4be14947cb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -Rubberduck Open-Source VBE Add-In - VBA6 | VBA7 x86/x64 | VB6 - + + - 2.3.0 + 2.2 @@ -65,7 +65,6 @@ 2.7.6684 - 1.8.4 @@ -82,20 +81,7 @@ 2.0.20525 - - - True - True - Settings.settings - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - + @@ -112,4 +98,38 @@ + + + + Designer + MSBuild:Compile + + + Code + %(Filename) + + + + Resources.resx + true + true + + + Resources.Designer.cs + ResXFileCodeGenerator + + + + True + True + Settings.settings + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + \ No newline at end of file diff --git a/Rubberduck.Core/Settings/GeneralSettings.cs b/Rubberduck.Core/Settings/GeneralSettings.cs index a16d961004..8446eed04c 100644 --- a/Rubberduck.Core/Settings/GeneralSettings.cs +++ b/Rubberduck.Core/Settings/GeneralSettings.cs @@ -19,9 +19,6 @@ public interface IGeneralSettings bool UserEditedLogLevel { get; set; } int MinimumLogLevel { get; set; } List EnableExperimentalFeatures { get; set; } - int RecentReferencesTracked { get; set; } - List RecentReferences { get; set; } - List PinnedReferences { get; set; } } [SettingsSerializeAs(SettingsSerializeAs.Xml)] @@ -61,10 +58,6 @@ public int MinimumLogLevel public List EnableExperimentalFeatures { get; set; } = new List(); - public int RecentReferencesTracked { get; set; } - public List RecentReferences { get; set; } - public List PinnedReferences { get; set; } - public GeneralSettings() { //Enforce non-default default value for members @@ -85,11 +78,8 @@ public bool Equals(GeneralSettings other) AutoSavePeriod == other.AutoSavePeriod && UserEditedLogLevel == other.UserEditedLogLevel && MinimumLogLevel == other.MinimumLogLevel && - RecentReferencesTracked == other.RecentReferencesTracked && - EnableExperimentalFeatures.Count == other.EnableExperimentalFeatures.Count && - EnableExperimentalFeatures.All(other.EnableExperimentalFeatures.Contains) && - RecentReferences.SequenceEqual(other.RecentReferences, StringComparer.OrdinalIgnoreCase) && - PinnedReferences.OrderBy(x => x).SequenceEqual(other.PinnedReferences.OrderBy(x => x), StringComparer.OrdinalIgnoreCase); + EnableExperimentalFeatures.All(a => other.EnableExperimentalFeatures.Contains(a)) && + EnableExperimentalFeatures.Count == other.EnableExperimentalFeatures.Count; } } } \ No newline at end of file diff --git a/Rubberduck.Core/Templates/ITemplate.cs b/Rubberduck.Core/Templates/ITemplate.cs deleted file mode 100644 index 370930f80c..0000000000 --- a/Rubberduck.Core/Templates/ITemplate.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Rubberduck.Templates -{ - public interface ITemplate - { - string Name { get; } - bool IsUserDefined { get; } - string Caption { get; } - string Description { get; } - string Read(); - void Write(string content); - } -} \ No newline at end of file diff --git a/Rubberduck.Core/Templates/Template.cs b/Rubberduck.Core/Templates/Template.cs deleted file mode 100644 index 5059c35d8a..0000000000 --- a/Rubberduck.Core/Templates/Template.cs +++ /dev/null @@ -1,69 +0,0 @@ -namespace Rubberduck.Templates -{ - /// - /// Template can be either built-in or user-defined. For a built-in template, the - /// metadata should be stored in the - /// resource, with specific entries, currently Name, Caption, Description and Code. - /// Due to the fact that we cannot strong-type the reference to the resource entries - /// the class has unit tests to validate that the crucial elements are present in the - /// resource to guard against runtime errors/unexpected behavior due to missing/malformed - /// entries in the resources. - /// - public class Template : ITemplate - { - private readonly ITemplateFileHandler _handler; - public Template(string name, ITemplateFileHandler handler) - { - _handler = handler; - - Name = name; - IsUserDefined = VerifyIfUserDefined(name); - - if (IsUserDefined) - { - //TODO: Devise a way for users to define their captions/descriptions simply - Caption = Name; - Description = Name; - } - else - { - VerifyFile(name, handler); - (Caption, Description) = GetBuiltInMetaData(name); - } - } - - public string Name { get; } - public bool IsUserDefined { get; } - public string Caption { get; } - public string Description { get; } - - public string Read() => _handler.Read(); - - public void Write(string content) => _handler.Write(content); - - private static bool VerifyIfUserDefined(string name) - { - var builtInName = Resources.Templates.ResourceManager.GetString(name + "_Name"); - return builtInName == null || builtInName != name; - } - - private static void VerifyFile(string name, ITemplateFileHandler handler) - { - if (handler.Exists) - { - return; - } - - var content = Resources.Templates.ResourceManager.GetString(name + "_Code"); - handler.Write(content); - } - - private static (string caption, string description) GetBuiltInMetaData(string name) - { - var caption = Resources.Templates.ResourceManager.GetString(name + "_Caption"); - var description = Resources.Templates.ResourceManager.GetString(name + "_Description"); - - return (caption, description); - } - } -} \ No newline at end of file diff --git a/Rubberduck.Core/Templates/TemplateFileHandler.cs b/Rubberduck.Core/Templates/TemplateFileHandler.cs deleted file mode 100644 index b093b114d9..0000000000 --- a/Rubberduck.Core/Templates/TemplateFileHandler.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Rubberduck.SettingsProvider; - -namespace Rubberduck.Templates -{ - public interface ITemplateFileHandlerProvider - { - ITemplateFileHandler CreateTemplateFileHandler(string templateName); - IEnumerable GetTemplateNames(); - } - - public class TemplateFileHandlerProvider : ITemplateFileHandlerProvider - { - private readonly string _rootPath; - - public TemplateFileHandlerProvider(IPersistancePathProvider pathProvider) - { - _rootPath = pathProvider.DataFolderPath("Templates"); - } - - public ITemplateFileHandler CreateTemplateFileHandler(string templateName) - { - if (!Directory.Exists(_rootPath)) - { - Directory.CreateDirectory(_rootPath); - } - - var fullPath = Path.Combine(_rootPath, templateName); - if (!Directory.Exists(Path.GetDirectoryName(fullPath))) - { - throw new InvalidOperationException("Cannot provide a path for where the parent directory do not exist"); - } - return new TemplateFileHandler(fullPath); - } - - public IEnumerable GetTemplateNames() - { - var info = new DirectoryInfo(_rootPath); - return info.GetFiles().Select(file => file.Name).ToList(); - } - } - - public interface ITemplateFileHandler - { - bool Exists { get; } - string Read(); - void Write(string content); - } - - public class TemplateFileHandler : ITemplateFileHandler - { - private readonly string _fullPath; - - public TemplateFileHandler(string fullPath) - { - _fullPath = fullPath + (fullPath.EndsWith(".rdt") ? string.Empty : ".rdt"); - } - - public bool Exists => File.Exists(_fullPath); - - public string Read() - { - return Exists ? File.ReadAllText(_fullPath) : null; - } - - public void Write(string content) - { - File.WriteAllText(_fullPath, content); - } - } -} \ No newline at end of file diff --git a/Rubberduck.Core/Templates/TemplateProvider.cs b/Rubberduck.Core/Templates/TemplateProvider.cs deleted file mode 100644 index a1c931ab9a..0000000000 --- a/Rubberduck.Core/Templates/TemplateProvider.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; - -namespace Rubberduck.Templates -{ - public interface ITemplateProvider - { - ITemplate Load(string templateName); - IEnumerable