提交 c7c9150d 编写于 作者: M Manish Vasani

Address feedback and add issues for all TODOs for suppressions that are either test or product bugs

上级 26a49624
......@@ -95,7 +95,7 @@ private bool CanRenameAttributePrefix(string triggerText)
// Ok, the symbol is good. Now, make sure that the trigger text starts with the prefix
// of the attribute. If it does, then we can rename just the attribute prefix (otherwise
// we need to rename the entire attribute).
#pragma warning disable IDE0059 // Unnecessary assignment of a value - TODO: File a bug, the code here is definitely incorrect.
#pragma warning disable IDE0059 // Unnecessary assignment of a value - https://github.com/dotnet/roslyn/issues/45895
var nameWithoutAttribute = GetWithoutAttributeSuffix(this.RenameSymbol.Name);
return triggerText.StartsWith(triggerText); // TODO: Always true? What was it supposed to do?
......
......@@ -205,11 +205,13 @@ public async Task<ImmutableArray<CodeFixCollection>> GetFixesAsync(Document docu
if (result.Count > 0 && _fixerPriorityMap.TryGetValue(document.Project.Language, out var fixersForLanguage))
{
// sort the result to the order defined by the fixers
var priorityMap = fixersForLanguage.Value;
#pragma warning disable IDE0007 // Use implicit type - Explicit type is need to suppress an incorrect nullable warning on dereferencing the map.
ImmutableDictionary<CodeFixProvider, int> priorityMap = fixersForLanguage.Value;
#pragma warning restore IDE0007 // Use implicit type
result.Sort((d1, d2) => GetValue(d1).CompareTo(GetValue(d2)));
int GetValue(CodeFixCollection c)
=> priorityMap!.TryGetValue((CodeFixProvider)c.Provider, out var value) ? value : int.MaxValue;
=> priorityMap.TryGetValue((CodeFixProvider)c.Provider, out var value) ? value : int.MaxValue;
}
// TODO (https://github.com/dotnet/roslyn/issues/4932): Don't restrict CodeFixes in Interactive
......
......@@ -78,7 +78,7 @@ protected static object CreateToolTipContent(Workspace workspace, DiagnosticData
}
protected virtual SnapshotSpan AdjustSnapshotSpan(SnapshotSpan span, int minimumLength)
=> AbstractDiagnosticsAdornmentTaggerProvider<TTag>.AdjustSnapshotSpan(span, minimumLength, int.MaxValue);
=> AdjustSnapshotSpan(span, minimumLength, int.MaxValue);
protected static SnapshotSpan AdjustSnapshotSpan(SnapshotSpan span, int minimumLength, int maximumLength)
{
......
......@@ -9,6 +9,10 @@ namespace Microsoft.CodeAnalysis.Editor.Shared.Extensions
{
internal static class ITextBufferEditExtensions
{
#pragma warning disable IDE0052 // Remove unread private members - Used for debugging.
private static Exception s_lastException = null;
#pragma warning restore IDE0052 // Remove unread private members
/// <summary>
/// Logs exceptions thrown during <see cref="ITextBufferEdit.Apply"/> as we look for issues.
/// </summary>
......@@ -22,6 +26,8 @@ public static ITextSnapshot ApplyAndLogExceptions(this ITextBufferEdit edit)
}
catch (Exception e) when (ErrorReporting.FatalError.ReportWithoutCrash(e))
{
s_lastException = e;
// Since we don't know what is causing this yet, I don't feel safe that catching
// will not cause some further downstream failure. So we'll continue to propagate.
throw;
......
......@@ -110,7 +110,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Rename
VerifyFileName(workspace.CurrentSolution.GetDocument(documentId), newIdentifierName)
End Sub
#Disable Warning IDE0060 ' Remove unused parameter - . TODO: File a test bug - this seems like a test bug that TestHost parameter is ignored.
#Disable Warning IDE0060 ' Remove unused parameter - https://github.com/dotnet/roslyn/issues/45890
Public Function CreateWorkspaceWithWaiter(element As XElement, host As TestHost) As TestWorkspace
#Enable Warning IDE0060 ' Remove unused parameter
Dim workspace = TestWorkspace.CreateWorkspace(
......
......@@ -24,7 +24,7 @@ public abstract class AbstractAutomaticLineEnderTests
internal abstract IChainedCommandHandler<AutomaticLineEnderCommandArgs> GetCommandHandler(TestWorkspace workspace);
#pragma warning disable IDE0060 // Remove unused parameter - TODO: File a test bug for 'completionActive' parameter being ignored here. We have tests passing this bool as true.
#pragma warning disable IDE0060 // Remove unused parameter - https://github.com/dotnet/roslyn/issues/45892
protected void Test(string expected, string code, bool completionActive = false, bool assertNextHandlerInvoked = false)
#pragma warning restore IDE0060 // Remove unused parameter
{
......
......@@ -59,7 +59,7 @@ internal static Action<QuickInfoItem> WarningGlyph(Glyph expectedGlyph)
protected static void AssertTaggedText(
string expectedText,
ImmutableArray<TaggedText> taggedText,
#pragma warning disable IDE0060 // Remove unused parameter - TODO: File a test bug. There are unit tests passing non-empty expectedClassifications.
#pragma warning disable IDE0060 // Remove unused parameter - https://github.com/dotnet/roslyn/issues/45893
FormattedClassification[] expectedClassifications = null)
#pragma warning restore IDE0060 // Remove unused parameter
{
......
......@@ -95,7 +95,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue.UnitTests
Dim span As TextSpan?
Try
span = VisualBasicEditAndContinueAnalyzer.TryGetDiagnosticSpanImpl(k, Nothing, EditKind.Update)
#Disable Warning IDE0059 ' Unnecessary assignment of a value - false positive, TODO: File a bug.
#Disable Warning IDE0059 ' Unnecessary assignment of a value - https://github.com/dotnet/roslyn/issues/45896
Catch e1 As NullReferenceException
#Enable Warning IDE0059 ' Unnecessary assignment of a value
' expected, we passed null node
......
......@@ -29,7 +29,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.SymbolId
#Region "Verification"
#Disable Warning IDE0060 ' Remove unused parameter - TODO: File a test bug for unused 'newCompilation' parameter. Should 'ResolveAndVerifySymbol' calls below use 'newCompilation'?
#Disable Warning IDE0060 ' Remove unused parameter - https://github.com/dotnet/roslyn/issues/45894
Friend Shared Sub ResolveAndVerifySymbolList(newSymbols As IEnumerable(Of ISymbol), newCompilation As Compilation, originalSymbols As IEnumerable(Of ISymbol), originalCompilation As Compilation)
#Enable Warning IDE0060 ' Remove unused parameter
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册