public void Reset(CodeAnalysisConfig configuration1, CodeAnalysisConfig configuration2) { Disabled.Clear(); SetValues(configuration1); SetValues(configuration2); }
protected override void SetValues(CodeAnalysisConfig configuration) { if (configuration == null) { return; } foreach (KeyValuePair <string, bool> kvp in configuration.CodeFixes) { string id = kvp.Key; bool isEnabled = kvp.Value; if (CodeFixIdentifier.TryParse(id, out CodeFixIdentifier codeFixIdentifier)) { Set(codeFixIdentifier, isEnabled); } else if (id.StartsWith(CodeFixIdentifier.CodeFixIdPrefix, StringComparison.Ordinal)) { foreach (string compilerDiagnosticId in CodeFixMap.GetCompilerDiagnosticIds(id)) { Set(new CodeFixIdentifier(compilerDiagnosticId, id), isEnabled); } } else if (id.StartsWith("CS", StringComparison.Ordinal)) { foreach (string codeFixId in CodeFixMap.GetCodeFixIds(id)) { Set(new CodeFixIdentifier(id, codeFixId), isEnabled); } } else { Debug.Fail(id); } } }
protected abstract void SetValues(CodeAnalysisConfig configuration);
internal void UpdateConfig() { CodeAnalysisConfig.UpdateVisualStudioConfig(f => f.WithCodeFixes(GetItems())); }
internal void UpdateConfig() { CodeAnalysisConfig.UpdateVisualStudioConfig(f => f.WithRefactorings(GetItems())); }