Пример #1
0
        private Configuration GetNondefaultConfig()
        {
            var generalSettings = new Rubberduck.Settings.GeneralSettings
            {
                Language       = new DisplayLanguageSetting("sv-SE"),
                HotkeySettings = new[]
                {
                    new HotkeySetting {
                        Name = "IndentProcedure", IsEnabled = false, Key1 = "CTRL-C"
                    },
                    new HotkeySetting {
                        Name = "IndentModule", IsEnabled = false, Key1 = "CTRL-X"
                    }
                },
                AutoSaveEnabled = true,
                AutoSavePeriod  = 5
            };

            var todoSettings = new ToDoListSettings
            {
                ToDoMarkers = new[]
                {
                    new ToDoMarker("PLACEHOLDER ")
                }
            };

            var inspections = Inspections().Select(i => new CodeInspectionSetting(i)).ToArray();

            inspections[0].Severity = CodeInspectionSeverity.Warning;
            inspections[1].Severity = CodeInspectionSeverity.Suggestion;
            inspections[2].Severity = CodeInspectionSeverity.Hint;
            inspections[3].Severity = CodeInspectionSeverity.Error;
            inspections[4].Severity = CodeInspectionSeverity.DoNotShow;
            inspections[5].Severity = CodeInspectionSeverity.Error;

            var inspectionSettings = new CodeInspectionSettings
            {
                CodeInspections = inspections
            };

            var unitTestSettings = new Rubberduck.Settings.UnitTestSettings
            {
                BindingMode = BindingMode.EarlyBinding,
                AssertMode  = AssertMode.PermissiveAssert,
                ModuleInit  = false,
                MethodInit  = false,
                DefaultTestStubInNewModule = true
            };

            var indenterSettings = new Rubberduck.Settings.IndenterSettings
            {
                IndentEntireProcedureBody      = false,
                IndentFirstCommentBlock        = false,
                IndentFirstDeclarationBlock    = false,
                AlignCommentsWithCode          = false,
                AlignContinuations             = false,
                IgnoreOperatorsInContinuations = false,
                IndentCase = true,
                ForceDebugStatementsInColumn1    = true,
                ForceCompilerDirectivesInColumn1 = true,
                IndentCompilerDirectives         = false,
                AlignDims             = true,
                AlignDimColumn        = 16,
                EnableUndo            = false,
                EndOfLineCommentStyle = Rubberduck.SmartIndenter.EndOfLineCommentStyle.Absolute,
                EndOfLineCommentColumnSpaceAlignment = 60,
                IndentSpaces = 2
            };

            var userSettings = new UserSettings(generalSettings, todoSettings, inspectionSettings, unitTestSettings, indenterSettings);

            return(new Configuration(userSettings));
        }
        private Configuration GetNondefaultConfig()
        {
            var generalSettings = new Rubberduck.Settings.GeneralSettings
            {
                Language = new DisplayLanguageSetting("sv-SE"),
                HotkeySettings = new[]
                {
                    new HotkeySetting{Name="IndentProcedure", IsEnabled=false, Key1="CTRL-C"},
                    new HotkeySetting{Name="IndentModule", IsEnabled=false, Key1="CTRL-X"}
                },
                AutoSaveEnabled = true,
                AutoSavePeriod = 5
            };

            var todoSettings = new ToDoListSettings
            {
                ToDoMarkers = new[]
                {
                    new ToDoMarker("PLACEHOLDER ")
                }
            };

            var inspections = Inspections().Select(i => new CodeInspectionSetting(i)).ToArray();
            inspections[0].Severity = CodeInspectionSeverity.Warning;
            inspections[1].Severity = CodeInspectionSeverity.Suggestion;
            inspections[2].Severity = CodeInspectionSeverity.Hint;
            inspections[3].Severity = CodeInspectionSeverity.Error;
            inspections[4].Severity = CodeInspectionSeverity.DoNotShow;
            inspections[5].Severity = CodeInspectionSeverity.Error;

            var inspectionSettings = new CodeInspectionSettings
            {
                CodeInspections = inspections
            };

            var unitTestSettings = new Rubberduck.Settings.UnitTestSettings
            {
                BindingMode = BindingMode.EarlyBinding,
                AssertMode = AssertMode.PermissiveAssert,
                ModuleInit = false,
                MethodInit = false,
                DefaultTestStubInNewModule = true
            };

            var indenterSettings = new Rubberduck.Settings.IndenterSettings
            {
                IndentEntireProcedureBody = false,
                IndentFirstCommentBlock = false,
                IndentFirstDeclarationBlock = false,
                AlignCommentsWithCode = false,
                AlignContinuations = false,
                IgnoreOperatorsInContinuations = false,
                IndentCase = true,
                ForceDebugStatementsInColumn1 = true,
                ForceCompilerDirectivesInColumn1 = true,
                IndentCompilerDirectives = false,
                AlignDims = true,
                AlignDimColumn = 16,
                EnableUndo = false,
                EndOfLineCommentStyle = Rubberduck.SmartIndenter.EndOfLineCommentStyle.Absolute,
                EndOfLineCommentColumnSpaceAlignment = 60,
                IndentSpaces = 2
            };

            var userSettings = new UserSettings(generalSettings, todoSettings, inspectionSettings, unitTestSettings, indenterSettings);
            return new Configuration(userSettings);
        }
Пример #3
0
        private Configuration GetDefaultConfig()
        {
            var generalSettings = new Rubberduck.Settings.GeneralSettings
            {
                Language       = new DisplayLanguageSetting("en-US"),
                HotkeySettings = new[]
                {
                    new HotkeySetting {
                        Name = "IndentProcedure", IsEnabled = true, Key1 = "^P"
                    },
                    new HotkeySetting {
                        Name = "IndentModule", IsEnabled = true, Key1 = "^M"
                    }
                },
                AutoSaveEnabled = false,
                AutoSavePeriod  = 10
            };

            var todoSettings = new ToDoListSettings
            {
                ToDoMarkers = new[]
                {
                    new ToDoMarker("NOTE "),
                    new ToDoMarker("TODO "),
                    new ToDoMarker("BUG ")
                }
            };

            var inspectionSettings = new CodeInspectionSettings
            {
                CodeInspections = Inspections().Select(i => new CodeInspectionSetting(i)).ToArray()
            };

            var unitTestSettings = new Rubberduck.Settings.UnitTestSettings
            {
                BindingMode = BindingMode.LateBinding,
                AssertMode  = AssertMode.StrictAssert,
                ModuleInit  = true,
                MethodInit  = true,
                DefaultTestStubInNewModule = false
            };

            var indenterSettings = new Rubberduck.Settings.IndenterSettings
            {
                IndentEntireProcedureBody      = true,
                IndentFirstCommentBlock        = true,
                IndentFirstDeclarationBlock    = true,
                AlignCommentsWithCode          = true,
                AlignContinuations             = true,
                IgnoreOperatorsInContinuations = true,
                IndentCase = false,
                ForceDebugStatementsInColumn1    = false,
                ForceCompilerDirectivesInColumn1 = false,
                IndentCompilerDirectives         = true,
                AlignDims             = false,
                AlignDimColumn        = 15,
                EnableUndo            = true,
                EndOfLineCommentStyle = Rubberduck.SmartIndenter.EndOfLineCommentStyle.AlignInColumn,
                EndOfLineCommentColumnSpaceAlignment = 50,
                IndentSpaces = 4
            };

            var userSettings = new UserSettings(generalSettings, todoSettings, inspectionSettings, unitTestSettings, indenterSettings);

            return(new Configuration(userSettings));
        }
        private Configuration GetDefaultConfig()
        {
            var generalSettings = new Rubberduck.Settings.GeneralSettings
            {
                Language = new DisplayLanguageSetting("en-US"),
                HotkeySettings = new[]
                {
                    new HotkeySetting{Name="IndentProcedure", IsEnabled=true, Key1="^P"},
                    new HotkeySetting{Name="IndentModule", IsEnabled=true, Key1="^M"}
                },
                AutoSaveEnabled = false,
                AutoSavePeriod = 10
            };

            var todoSettings = new ToDoListSettings
            {
                ToDoMarkers = new[]
                {
                    new ToDoMarker("NOTE "),
                    new ToDoMarker("TODO "),
                    new ToDoMarker("BUG ")
                }
            };

            var inspectionSettings = new CodeInspectionSettings
            {
                CodeInspections = Inspections().Select(i => new CodeInspectionSetting(i)).ToArray()
            };

            var unitTestSettings = new Rubberduck.Settings.UnitTestSettings
            {
                BindingMode = BindingMode.LateBinding,
                AssertMode = AssertMode.StrictAssert,
                ModuleInit = true,
                MethodInit = true,
                DefaultTestStubInNewModule = false
            };

            var indenterSettings = new Rubberduck.Settings.IndenterSettings
            {
                IndentEntireProcedureBody = true,
                IndentFirstCommentBlock = true,
                IndentFirstDeclarationBlock = true,
                AlignCommentsWithCode = true,
                AlignContinuations = true,
                IgnoreOperatorsInContinuations = true,
                IndentCase = false,
                ForceDebugStatementsInColumn1 = false,
                ForceCompilerDirectivesInColumn1 = false,
                IndentCompilerDirectives = true,
                AlignDims = false,
                AlignDimColumn = 15,
                EnableUndo = true,
                EndOfLineCommentStyle = Rubberduck.SmartIndenter.EndOfLineCommentStyle.AlignInColumn,
                EndOfLineCommentColumnSpaceAlignment = 50,
                IndentSpaces = 4
            };

            var userSettings = new UserSettings(generalSettings, todoSettings, inspectionSettings, unitTestSettings, indenterSettings);
            return new Configuration(userSettings);
        }