Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Globalization;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Updater;
Expand Down Expand Up @@ -36,6 +37,7 @@ public AnalyzerSetting(DiagnosticDescriptor descriptor,
IsEnabled = enabled;
Severity = severity;
Language = language;
IsNotConfigurable = descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.NotConfigurable);
Location = location;
}

Expand All @@ -46,6 +48,7 @@ public AnalyzerSetting(DiagnosticDescriptor descriptor,
public DiagnosticSeverity Severity { get; private set; }
public bool IsEnabled { get; private set; }
public Language Language { get; }
public bool IsNotConfigurable { get; set; }
public SettingLocation Location { get; }

internal void ChangeSeverity(DiagnosticSeverity severity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ public SeverityControl(AnalyzerSetting setting)

_comboBox.SelectionChanged += ComboBox_SelectionChanged;
_comboBox.SetValue(AutomationProperties.NameProperty, ServicesVSResources.Severity);
if (setting.IsNotConfigurable)
{
_comboBox.IsEnabled = false;
ToolTip = ServicesVSResources.This_rule_is_not_configurable;
}

_ = RootGrid.Children.Add(_comboBox);
_setting = setting;
}
Expand Down
3 changes: 3 additions & 0 deletions src/VisualStudio/Core/Def/ServicesVSResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,9 @@ Additional information: {1}</value>
<data name="Search_Settings" xml:space="preserve">
<value>Search Settings</value>
</data>
<data name="This_rule_is_not_configurable" xml:space="preserve">
<value>This rule is not configurable</value>
</data>
<data name="Multiple_members_are_inherited" xml:space="preserve">
<value>Multiple members are inherited</value>
</data>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.