Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused parameter #75571

Merged
merged 1 commit into from
Oct 21, 2024
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 @@ -24,35 +24,32 @@ protected override SyntaxNode ParseCompilation(string text, ParseOptions parseOp

private protected Task AssertNoFormattingChangesAsync(
string code,
bool debugMode = false,
OptionsCollection changedOptionSet = null,
bool testWithTransformation = true,
ParseOptions parseOptions = null)
{
return AssertFormatAsync(code, code, [new TextSpan(0, code.Length)], debugMode, changedOptionSet, testWithTransformation, parseOptions);
return AssertFormatAsync(code, code, [new TextSpan(0, code.Length)], changedOptionSet, testWithTransformation, parseOptions);
}

private protected Task AssertFormatAsync(
string expected,
string code,
bool debugMode = false,
OptionsCollection changedOptionSet = null,
bool testWithTransformation = true,
ParseOptions parseOptions = null)
{
return AssertFormatAsync(expected, code, [new TextSpan(0, code.Length)], debugMode, changedOptionSet, testWithTransformation, parseOptions);
return AssertFormatAsync(expected, code, [new TextSpan(0, code.Length)], changedOptionSet, testWithTransformation, parseOptions);
}

private protected Task AssertFormatAsync(
string expected,
string code,
IEnumerable<TextSpan> spans,
bool debugMode = false,
OptionsCollection changedOptionSet = null,
bool testWithTransformation = true,
ParseOptions parseOptions = null)
{
return AssertFormatAsync(expected, code, spans, LanguageNames.CSharp, debugMode, changedOptionSet, testWithTransformation, parseOptions);
return AssertFormatAsync(expected, code, spans, LanguageNames.CSharp, changedOptionSet, testWithTransformation, parseOptions);
}
}
}
34 changes: 17 additions & 17 deletions src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ class D
{
public int A { get; set; }
public int B { get; set; }
}", false, changingOptions);
}", changingOptions);
}

[Fact]
Expand Down Expand Up @@ -1023,7 +1023,7 @@ public void nothing()
string s = o as string;
bool b = o is string;
}
}", false, changingOptions);
}", changingOptions);
}

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/772298")]
Expand Down Expand Up @@ -1569,7 +1569,7 @@ void bar()
}
void goo() { int xx = 0; int zz = 0;}
}
class goo{int x = 0;}", false, changingOptions);
class goo{int x = 0;}", changingOptions);
}

[Fact]
Expand Down Expand Up @@ -1636,7 +1636,7 @@ void bar()
class goo
{
int x = 0;
}", false, changingOptions);
}", changingOptions);
}

[Fact]
Expand Down Expand Up @@ -1718,7 +1718,7 @@ void bar()
Del d = delegate(int k) { Console.WriteLine(); Console.WriteLine(); };
}
}
class goo{int x = 0;}", false, changingOptions);
class goo{int x = 0;}", changingOptions);
}

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/991480")]
Expand All @@ -1741,7 +1741,7 @@ static void Main(string[] args)
{
for (int d = 0; d < 10; ++d) { }
}
}", false, changingOptions);
}", changingOptions);
}

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/751789")]
Expand Down Expand Up @@ -2000,7 +2000,7 @@ public class goo : System.Object

{
}
}", false, changingOptions);
}", changingOptions);
}

[Fact]
Expand Down Expand Up @@ -2122,7 +2122,7 @@ void f00(){
return 0;
}
}
}", false, changingOptions);
}", changingOptions);
}

[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/33458")]
Expand Down Expand Up @@ -2288,7 +2288,7 @@ from o in c.Orders orderby o.Total descending
Y2 = 3
};
}
}", false, changingOptions);
}", changingOptions);
}

[Fact]
Expand Down Expand Up @@ -6013,7 +6013,7 @@ void F()
}
}
}";
await AssertFormatAsync(expected, code, false, changingOptions);
await AssertFormatAsync(expected, code, changingOptions);
}

[Fact, WorkItem(707064, "DevDiv_Projects/Roslyn")]
Expand Down Expand Up @@ -6518,7 +6518,7 @@ void Method()
}
}
";
await AssertFormatAsync(expected, code, false, changingOptions);
await AssertFormatAsync(expected, code, changingOptions);
}

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/772311")]
Expand Down Expand Up @@ -8056,7 +8056,7 @@ static void Main(string[] args)
{
Console.WriteLine(""""); // GooBar
}
}", false, optionSet);
}", optionSet);
}

[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/1151")]
Expand All @@ -8081,7 +8081,7 @@ static void Main(string[] args)
{
Console.WriteLine(""""); /* GooBar */
}
}", false, optionSet);
}", optionSet);
}

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1100920")]
Expand Down Expand Up @@ -8262,7 +8262,7 @@ class Program
static void Main(string[] args)
{
}
}", false, changingOptions);
}", changingOptions);
}

[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/776")]
Expand Down Expand Up @@ -8784,7 +8784,7 @@ int MethodGoo()
{
return 42;
}
}", false, changingOptions);
}", changingOptions);
}

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/849870")]
Expand Down Expand Up @@ -8822,7 +8822,7 @@ int MethodGoo()
{
return 42;
}
}", false, changingOptions);
}", changingOptions);
}

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/849870")]
Expand Down Expand Up @@ -8861,7 +8861,7 @@ int MethodGoo()
{
return 42;
}
}", false, changingOptions);
}", changingOptions);
}

[Fact, WorkItem(111079, "devdiv.visualstudio.com")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void Method()
}
}";

await AssertFormatAsync(expected, content, true);
await AssertFormatAsync(expected, content);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,17 @@ private protected Task AssertFormatAsync(
string expected,
string code,
string language,
bool debugMode = false,
OptionsCollection? changedOptionSet = null,
bool testWithTransformation = true)
{
return AssertFormatAsync(expected, code, [new TextSpan(0, code.Length)], language, debugMode, changedOptionSet, testWithTransformation);
return AssertFormatAsync(expected, code, [new TextSpan(0, code.Length)], language, changedOptionSet, testWithTransformation);
}

private protected async Task AssertFormatAsync(
string expected,
string code,
IEnumerable<TextSpan> spans,
string language,
#pragma warning disable IDE0060 // Remove unused parameter - https://github.com/dotnet/roslyn/issues/44225
bool debugMode = false,
#pragma warning restore IDE0060 // Remove unused parameter
OptionsCollection? changedOptions = null,
bool treeCompare = true,
ParseOptions? parseOptions = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,7 @@ End Module")
Dim code = "Dim a = New Object ( )"
Dim expected = " Dim a = New Object()"

Await AssertFormatAsync(CreateMethod(code), CreateMethod(expected), debugMode:=True)
Await AssertFormatAsync(CreateMethod(code), CreateMethod(expected))
End Function

<Fact>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,16 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Formatting
Private Protected Overloads Function AssertFormatAsync(
code As String,
expected As String,
Optional debugMode As Boolean = False,
Optional changedOptionSet As OptionsCollection = Nothing,
Optional testWithTransformation As Boolean = False,
Optional experimental As Boolean = False) As Task
Return AssertFormatAsync(expected, code, SpecializedCollections.SingletonEnumerable(New TextSpan(0, code.Length)), debugMode, changedOptionSet, testWithTransformation, experimental:=experimental)
Return AssertFormatAsync(expected, code, SpecializedCollections.SingletonEnumerable(New TextSpan(0, code.Length)), changedOptionSet, testWithTransformation, experimental:=experimental)
End Function

Private Protected Overloads Function AssertFormatAsync(
expected As String,
code As String,
spans As IEnumerable(Of TextSpan),
Optional debugMode As Boolean = False,
Optional changedOptionSet As OptionsCollection = Nothing,
Optional testWithTransformation As Boolean = False,
Optional experimental As Boolean = False) As Task
Expand All @@ -114,7 +112,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Formatting
' parseOptions = parseOptions.WithExperimentalFeatures
End If

Return AssertFormatAsync(expected, code, spans, LanguageNames.VisualBasic, debugMode, changedOptionSet, testWithTransformation, parseOptions)
Return AssertFormatAsync(expected, code, spans, LanguageNames.VisualBasic, changedOptionSet, testWithTransformation, parseOptions)
End Function

Private Shared Function StringFromLines(ParamArray lines As String()) As String
Expand Down
Loading