Skip to content

Commit 9f7d5c5

Browse files
authored
Re-enable IDE0051 (#78919)
This re-enables the unused member analyzer and removes all of the methods it flagged as unused.
1 parent 0256a95 commit 9f7d5c5

File tree

5 files changed

+3
-62
lines changed

5 files changed

+3
-62
lines changed

src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6660,7 +6660,7 @@ public void ResponseFileSplitting()
66606660
}
66616661

66626662
[ConditionalFact(typeof(WindowsOnly))]
6663-
private void SourceFileQuoting()
6663+
public void SourceFileQuoting()
66646664
{
66656665
string[] responseFile = new string[] {
66666666
@"d:\\""abc def""\baz.cs ab""c d""e.cs",
@@ -12060,7 +12060,6 @@ at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.CreateDisablingMessage(Di
1206012060

1206112061
Assert.Equal(0, result.ExitCode);
1206212062
}
12063-
#endif
1206412063

1206512064
private static ImmutableArray<byte> CreateCSharpAnalyzerNetStandard13(string analyzerAssemblyName)
1206612065
{
@@ -12221,6 +12220,8 @@ public override void Initialize(AnalysisContext context)
1222112220
return analyzerImage;
1222212221
}
1222312222

12223+
#endif
12224+
1222412225
[WorkItem(406649, "https://devdiv.visualstudio.com/DevDiv/_workitems?id=484417")]
1222512226
[ConditionalFact(typeof(WindowsDesktopOnly), typeof(IsEnglishLocal), Reason = "https://github.com/dotnet/roslyn/issues/30321")]
1222612227
public void MicrosoftDiaSymReaderNativeAltLoadPath()

src/Compilers/Core/CodeAnalysisTest/Collections/List/IEnumerable.Generic.Tests.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -155,37 +155,6 @@ private void RepeatTest(
155155
RepeatTest((e, i, it) => testCode(e, i), iters);
156156
}
157157

158-
private void VerifyModifiedEnumerator(
159-
IEnumerator<T> enumerator,
160-
object expectedCurrent,
161-
bool expectCurrentThrow,
162-
bool atEnd)
163-
{
164-
if (expectCurrentThrow)
165-
{
166-
Assert.Throws<InvalidOperationException>(
167-
() => enumerator.Current);
168-
}
169-
else
170-
{
171-
object? current = enumerator.Current;
172-
for (int i = 0; i < 3; i++)
173-
{
174-
Assert.Equal(expectedCurrent, current);
175-
current = enumerator.Current;
176-
}
177-
}
178-
179-
Assert.Throws<InvalidOperationException>(
180-
() => enumerator.MoveNext());
181-
182-
if (!!ResetImplemented)
183-
{
184-
Assert.Throws<InvalidOperationException>(
185-
() => enumerator.Reset());
186-
}
187-
}
188-
189158
private void VerifyEnumerator(
190159
IEnumerator<T> enumerator,
191160
T[] expectedItems)

src/Compilers/Core/RebuildTest/RebuildCommandLineTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ private void AddSourceFile(string filePath, string content)
3838
FilePathToStreamMap.Add(Path.Combine(BuildPaths.WorkingDirectory, filePath), new TestableFile(content));
3939
}
4040

41-
private void AddReference(string filePath, byte[] imageBytes)
42-
{
43-
FilePathToStreamMap.Add(Path.Combine(BuildPaths.SdkDirectory!, filePath), new TestableFile(imageBytes));
44-
}
45-
4641
private void AddOutputFile(ref string? filePath)
4742
{
4843
if (filePath is object)

src/Compilers/Test/Core/Compilation/OperationTreeVerifier.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,6 @@ private static string GetSnippetFromSyntax(SyntaxNode syntax)
175175
return $"'{prefix} ... {suffix}'";
176176
}
177177

178-
private static bool ShouldLogType(IOperation operation)
179-
{
180-
var operationKind = (int)operation.Kind;
181-
182-
// Expressions
183-
if (operationKind >= 0x100 && operationKind < 0x400)
184-
{
185-
return true;
186-
}
187-
188-
return false;
189-
}
190-
191178
protected void LogString(string str)
192179
{
193180
if (_pendingIndent)
@@ -409,11 +396,6 @@ private void VisitArray<T>(ImmutableArray<T> list, string header, bool logElemen
409396
VisitArrayCommon(list, header, logElementCount, logNullForDefault, o => Visit(o));
410397
}
411398

412-
private void VisitArray(ImmutableArray<ISymbol> list, string header, bool logElementCount, bool logNullForDefault = false)
413-
{
414-
VisitArrayCommon(list, header, logElementCount, logNullForDefault, VisitSymbolArrayElement);
415-
}
416-
417399
private void VisitArray(ImmutableArray<string> list, string header, bool logElementCount, bool logNullForDefault = false)
418400
{
419401
VisitArrayCommon(list, header, logElementCount, logNullForDefault, VisitStringArrayElement);

src/Compilers/VisualBasic/Portable/Symbols/Source/SourceAssemblySymbol.vb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
519519
Return _lazyNetModuleAttributesBag
520520
End Function
521521

522-
Private Function GetNetModuleAttributes() As ImmutableArray(Of VisualBasicAttributeData)
523-
Dim attributesBag = Me.GetNetModuleAttributesBag()
524-
Debug.Assert(attributesBag.IsSealed)
525-
Return attributesBag.Attributes
526-
End Function
527-
528522
Friend Function GetNetModuleDecodedWellKnownAttributeData() As CommonAssemblyWellKnownAttributeData
529523
Dim attributesBag = Me.GetNetModuleAttributesBag()
530524
Debug.Assert(attributesBag.IsSealed)

0 commit comments

Comments
 (0)