private void MapClangFormatOptionsToSettings(ClangFormatOptions clangFormat)
        {
            FormatSettingsModel formatSettingsModel = new FormatSettingsModel();
              formatSettingsModel.FileExtensions = clangFormat.FileExtensions;
              formatSettingsModel.FilesToIgnore = clangFormat.SkipFiles;
              formatSettingsModel.AssumeFilename = clangFormat.AssumeFilename;
              formatSettingsModel.CustomExecutable = clangFormat.ClangFormatPath.Value;
              formatSettingsModel.Style = clangFormat.Style;
              formatSettingsModel.FallbackStyle = clangFormat.FallbackStyle;
              formatSettingsModel.FormatOnSave = clangFormat.EnableFormatOnSave;

              settingsProvider.SetFormatSettingsModel(formatSettingsModel);
        }
        private void MapOldSettings()
        {
            ClangOptions clangOptions = LoadOldSettingsFromFile(new ClangOptions(), GeneralConfigurationFileName);
              MapClangOptionsToSettings(clangOptions);

              ClangFormatOptions clangFormatOptions = LoadOldSettingsFromFile(new ClangFormatOptions(), FormatConfigurationFileName);
              MapClangFormatOptionsToSettings(clangFormatOptions);

              ClangTidyOptions clangTidyOptions = LoadOldSettingsFromFile(new ClangTidyOptions(), TidyOptionsConfigurationFileName);
              MapClangTidyOptionsToSettings(clangTidyOptions);

              ClangTidyPredefinedChecksOptions clangTidyPredefinedChecksOptions = LoadOldSettingsFromFile(new ClangTidyPredefinedChecksOptions(), TidyPredefinedChecksConfigurationFileName);
              MapTidyPredefinedChecksToTidyettings(clangTidyPredefinedChecksOptions);
        }
Exemple #3
0
        private void MapClangFormatOptionsToSettings(ClangFormatOptions clangFormat)
        {
            var formatSettingsModel = new FormatSettingsModel
            {
                FileExtensions   = clangFormat.FileExtensions,
                FilesToIgnore    = clangFormat.SkipFiles,
                AssumeFilename   = clangFormat.AssumeFilename,
                CustomExecutable = clangFormat.ClangFormatPath.Value,
                Style            = clangFormat.Style,
                FallbackStyle    = clangFormat.FallbackStyle,
                FormatOnSave     = clangFormat.EnableFormatOnSave
            };

            SettingsProvider.FormatSettingsModel = formatSettingsModel;
        }