예제 #1
0
 public static FormattingSetting <TOption> Create <TOption>(Option2 <TOption> option,
                                                            string description,
                                                            AnalyzerConfigOptions editorConfigOptions,
                                                            OptionSet visualStudioOptions,
                                                            OptionUpdater updater)
     where TOption : struct
 {
     return(new FormattingSetting <TOption>(option, description, editorConfigOptions, visualStudioOptions, updater));
 }
예제 #2
0
 public static PerLanguageFormattingSetting <TOption> Create <TOption>(PerLanguageOption2 <TOption> option,
                                                                       string description,
                                                                       AnalyzerConfigOptions editorConfigOptions,
                                                                       OptionSet visualStudioOptions,
                                                                       OptionUpdater updater)
     where TOption : notnull
 {
     return(new PerLanguageFormattingSetting <TOption>(option, description, editorConfigOptions, visualStudioOptions, updater));
 }
예제 #3
0
 protected FormattingSetting(
     string description,
     OptionUpdater updater,
     string?language = null
     )
 {
     Description = description ?? throw new ArgumentNullException(nameof(description));
     Updater     = updater;
     Language    = language;
 }
예제 #4
0
 internal static CodeStyleSetting Create(PerLanguageOption2 <CodeStyleOption2 <bool> > option,
                                         string description,
                                         AnalyzerConfigOptions editorConfigOptions,
                                         OptionSet visualStudioOptions,
                                         OptionUpdater updater,
                                         string?trueValueDescription  = null,
                                         string?falseValueDescription = null)
 {
     return(new PerLanguageBooleanCodeStyleSetting(option, description, trueValueDescription, falseValueDescription, editorConfigOptions, visualStudioOptions, updater));
 }
예제 #5
0
 public BooleanCodeStyleSettingBase(string description,
                                    string category,
                                    string?trueValueDescription,
                                    string?falseValueDescription,
                                    OptionUpdater updater)
     : base(description, updater)
 {
     Category = category;
     _trueValueDescription  = trueValueDescription ?? EditorFeaturesResources.Yes;
     _falseValueDescription = falseValueDescription ?? EditorFeaturesResources.No;
 }
 public PerLanguageFormattingSetting(PerLanguageOption2 <T> option,
                                     string description,
                                     AnalyzerConfigOptions editorConfigOptions,
                                     OptionSet visualStudioOptions,
                                     OptionUpdater updater)
     : base(description, updater)
 {
     _option = option;
     _editorConfigOptions = editorConfigOptions;
     _visualStudioOptions = visualStudioOptions;
 }
예제 #7
0
 internal static CodeStyleSetting Create <T>(PerLanguageOption2 <CodeStyleOption2 <T> > option,
                                             string description,
                                             T[] enumValues,
                                             string[] valueDescriptions,
                                             AnalyzerConfigOptions editorConfigOptions,
                                             OptionSet visualStudioOptions,
                                             OptionUpdater updater)
     where T : Enum
 {
     return(new PerLanguageEnumCodeStyleSetting <T>(option, description, enumValues, valueDescriptions, editorConfigOptions, visualStudioOptions, updater));
 }
 public PerLanguageWhitespaceSetting(PerLanguageOption2 <T> option,
                                     string description,
                                     AnalyzerConfigOptions editorConfigOptions,
                                     OptionSet visualStudioOptions,
                                     OptionUpdater updater,
                                     SettingLocation location)
     : base(description, updater, location)
 {
     _option = option;
     _editorConfigOptions = editorConfigOptions;
     _visualStudioOptions = visualStudioOptions;
 }
 public PerLanguageEnumCodeStyleSetting(PerLanguageOption2 <CodeStyleOption2 <T> > option,
                                        string description,
                                        T[] enumValues,
                                        string[] valueDescriptions,
                                        AnalyzerConfigOptions editorConfigOptions,
                                        OptionSet visualStudioOptions,
                                        OptionUpdater updater)
     : base(description, enumValues, valueDescriptions, option.Group.Description, updater)
 {
     _option = option;
     _editorConfigOptions = editorConfigOptions;
     _visualStudioOptions = visualStudioOptions;
 }
 public BooleanCodeStyleSetting(Option2 <CodeStyleOption2 <bool> > option,
                                string description,
                                string?trueValueDescription,
                                string?falseValueDescription,
                                AnalyzerConfigOptions editorConfigOptions,
                                OptionSet visualStudioOptions,
                                OptionUpdater updater,
                                string fileName)
     : base(description, option.Group.Description, trueValueDescription, falseValueDescription, updater)
 {
     _option = option;
     _editorConfigOptions = editorConfigOptions;
     _visualStudioOptions = visualStudioOptions;
     Location             = new SettingLocation(IsDefinedInEditorConfig ? LocationKind.EditorConfig : LocationKind.VisualStudio, fileName);
 }
 public EnumCodeStyleSetting(Option2 <CodeStyleOption2 <T> > option,
                             string description,
                             T[] enumValues,
                             string[] valueDescriptions,
                             AnalyzerConfigOptions editorConfigOptions,
                             OptionSet visualStudioOptions,
                             OptionUpdater updater,
                             string fileName)
     : base(description, enumValues, valueDescriptions, option.Group.Description, updater)
 {
     _option = option;
     _editorConfigOptions = editorConfigOptions;
     _visualStudioOptions = visualStudioOptions;
     Location             = new SettingLocation(IsDefinedInEditorConfig ? LocationKind.EditorConfig : LocationKind.VisualStudio, fileName);
 }
예제 #12
0
 public CodeStyleSetting(string description, OptionUpdater updater)
 {
     Description = description;
     Updater     = updater;
 }
예제 #13
0
        public ISettingsProvider <FormattingSetting> GetForFile(string filePath)
        {
            var updaterService = new OptionUpdater(_workspace, filePath);

            return(new CSharpFormattingSettingsProvider(filePath, updaterService, _workspace));
        }