提交 4fe9116e 编写于 作者: M Manish Vasani 提交者: GitHub

Explicitly state that suppression state column in error list is only supported...

Explicitly state that suppression state column in error list is only supported for intellisense diagnostics (#13387)

1. Suppression state column shows N/A for build diagnostics.
2. A descriptive tooltip is now shown on error list entries with unsupported suppression state, guiding users to switch to intellisense diagnostics for suppression.

Fixes #11371
上级 c3bdaf60
......@@ -18,8 +18,8 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource
internal class SuppressionStateColumnDefinition : TableColumnDefinitionBase
{
public const string ColumnName = "suppressionstate";
private static readonly string[] s_defaultFilters = new[] { ServicesVSResources.Active, ServicesVSResources.Suppressed };
private static readonly string[] s_defaultCheckedFilters = new[] { ServicesVSResources.Active };
private static readonly string[] s_defaultFilters = new[] { ServicesVSResources.Active, ServicesVSResources.NotApplicable, ServicesVSResources.Suppressed };
private static readonly string[] s_defaultCheckedFilters = new[] { ServicesVSResources.Active, ServicesVSResources.NotApplicable };
public override string Name => ColumnName;
public override string DisplayName => ServicesVSResources.Suppression_State;
......@@ -38,6 +38,20 @@ public static void SetDefaultFilter(IWpfTableControl tableControl)
tableControl.SetFilter(ColumnName, new ColumnHashSetFilter(suppressionStateColumn, excluded: ServicesVSResources.Suppressed));
}
}
public override bool TryCreateToolTip(ITableEntryHandle entry, out object toolTip)
{
object content;
if (entry.TryGetValue(ColumnName, out content) &&
content as string == ServicesVSResources.NotApplicable)
{
toolTip = ServicesVSResources.SuppressionNotSupportedToolTip;
return true;
}
toolTip = null;
return false;
}
}
}
......@@ -233,9 +233,9 @@ public override bool TryGetValue(int index, string columnName, out object conten
content = item.ProjectGuids;
return ((Guid[])content).Length > 0;
case SuppressionStateColumnDefinition.ColumnName:
// Build doesn't report suppressed diagnostics.
// Build doesn't support suppression.
Contract.ThrowIfTrue(data.IsSuppressed);
content = ServicesVSResources.Active;
content = ServicesVSResources.NotApplicable;
return true;
default:
content = null;
......
......@@ -1158,6 +1158,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to N/A.
/// </summary>
internal static string NotApplicable {
get {
return ResourceManager.GetString("NotApplicable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to OK.
/// </summary>
......@@ -1560,6 +1569,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Suppression state is supported only for intellisense diagnostics, which are for the current solution snapshot. Switch to &apos;Intellisense&apos; diagnostics for suppression..
/// </summary>
internal static string SuppressionNotSupportedToolTip {
get {
return ResourceManager.GetString("SuppressionNotSupportedToolTip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Symbol Kinds (can match any).
/// </summary>
......
......@@ -480,6 +480,12 @@ Use the dropdown to view and switch to other projects this file may belong to.</
<data name="Suppressed" xml:space="preserve">
<value>Suppressed</value>
</data>
<data name="NotApplicable" xml:space="preserve">
<value>N/A</value>
</data>
<data name="SuppressionNotSupportedToolTip" xml:space="preserve">
<value>Suppression state is supported only for intellisense diagnostics, which are for the current solution snapshot. Switch to 'Intellisense' diagnostics for suppression.</value>
</data>
<data name="Suppress_diagnostics" xml:space="preserve">
<value>Suppress diagnostics</value>
</data>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册