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 @@ -125,7 +125,7 @@ class C
public static implicit operator C(int v) => throw new NotImplementedException();
}
""",
options: Option(CSharpCodeStyleOptions.PreferExpressionBodiedOperators, CSharpCodeStyleOptions.WhenPossibleWithSilentEnforcement));
options: Option(CSharpCodeStyleOptions.PreferExpressionBodiedOperators, CSharpCodeStyleOptions.WhenPossibleWithSilentEnforcement));

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/774321")]
public Task TestGenerateImplicitConversionAwaitExpression()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,25 +290,25 @@ bool otherFunction()
}
}
""",
$$"""
using System;
$$"""
using System;

class C
{
void M()
{
bool otherFunction()
{
return true;
}{{leadingTrivia}}
static int fibonacci(int n)
{
return n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
}
}
}
""",
parseOptions: CSharp8ParseOptions);
class C
{
void M()
{
bool otherFunction()
{
return true;
}{{leadingTrivia}}
static int fibonacci(int n)
{
return n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
}
}
}
""",
parseOptions: CSharp8ParseOptions);

[Theory, Trait(Traits.Feature, Traits.Features.CodeActionsMakeLocalFunctionStatic)]
[InlineData("")]
Expand All @@ -328,19 +328,19 @@ void M()
}
}
""",
$$"""
using System;
$$"""
using System;

class C
{
void M()
{
bool otherFunction() => true;{{leadingTrivia}}
static int fibonacci(int n) => n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
}
}
""",
parseOptions: CSharp8ParseOptions);
class C
{
void M()
{
bool otherFunction() => true;{{leadingTrivia}}
static int fibonacci(int n) => n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
}
}
""",
parseOptions: CSharp8ParseOptions);

[Theory, Trait(Traits.Feature, Traits.Features.CodeActionsMakeLocalFunctionStatic)]
[InlineData("")]
Expand Down Expand Up @@ -378,7 +378,7 @@ static int fibonacci(int n)
}
}
""",
parseOptions: CSharp8ParseOptions);
parseOptions: CSharp8ParseOptions);

[Theory, Trait(Traits.Feature, Traits.Features.CodeActionsMakeLocalFunctionStatic)]
[InlineData("\r\n")]
Expand Down Expand Up @@ -415,7 +415,7 @@ static int fibonacci(int n)
}
}
""",
parseOptions: CSharp8ParseOptions);
parseOptions: CSharp8ParseOptions);

[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMakeLocalFunctionStatic)]
[WorkItem("https://github.com/dotnet/roslyn/issues/46858")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5819,26 +5819,26 @@ int M(bool flag)
int M3() => 0;
}
""",
$$"""
class C
{
int M(bool flag)
{
int x;
if ({{condition}})
{
}
else
{
}
$$"""
class C
{
int M(bool flag)
{
int x;
if ({{condition}})
{
}
else
{
}

return x;
}
return x;
}

bool M2(out int x) { x = 0; return true; }
int M3() => 0;
}
""");
bool M2(out int x) { x = 0; return true; }
int M3() => 0;
}
""");

[Theory]
[InlineData(nameof(PreferDiscard))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ public Task ShortDiscardInAssignment(TestHost testHost)
=> TestInMethodAsync(
code: @"_ = 1;",
testHost: testHost,
expected: Classifications(Identifier("_"), Operators.Equals, Number("1"), Punctuation.Semicolon));
expected: Classifications(Identifier("_"), Operators.Equals, Number("1"), Punctuation.Semicolon));

[Theory, CombinatorialData]
public Task UnderscoreInLambda(TestHost testHost)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ IDictionary Method()
}
}
""",
testHost, index: 1);
testHost, index: 1);

[Theory, CombinatorialData]
public Task TestGenericWithNoArgs(TestHost testHost)
Expand Down Expand Up @@ -383,7 +383,7 @@ class Class
}
}
""",
count: 1);
count: 1);

[Theory, CombinatorialData]
public Task TestExistingUsing(TestHost testHost)
Expand Down Expand Up @@ -479,7 +479,7 @@ public static void Where(this Class c)
}
}
""",
parseOptions: Options.Regular);
parseOptions: Options.Regular);

[Theory, CombinatorialData]
public Task TestOnEnum(TestHost testHost)
Expand Down Expand Up @@ -1434,7 +1434,7 @@ public static void Bar()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleSystemSortedUsings2(TestHost testHost)
Expand Down Expand Up @@ -1486,7 +1486,7 @@ public static void Bar()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleSystemSortedUsings3(TestHost testHost)
Expand Down Expand Up @@ -1516,7 +1516,7 @@ void Method()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleSystemUnsortedUsings1(TestHost testHost)
Expand Down Expand Up @@ -1568,7 +1568,7 @@ public static void Bar()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleSystemUnsortedUsings2(TestHost testHost)
Expand Down Expand Up @@ -1620,7 +1620,7 @@ public static void Bar()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleSystemUnsortedUsings3(TestHost testHost)
Expand Down Expand Up @@ -1650,7 +1650,7 @@ void Method()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleBogusSystemUsings1(TestHost testHost)
Expand Down Expand Up @@ -1678,7 +1678,7 @@ void Method()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleBogusSystemUsings2(TestHost testHost)
Expand Down Expand Up @@ -1706,7 +1706,7 @@ void Method()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestUsingsWithComments(TestHost testHost)
Expand Down Expand Up @@ -1734,7 +1734,7 @@ void Method()
}
}
""",
testHost);
testHost);

// System Not on top cases
[Theory, CombinatorialData]
Expand Down Expand Up @@ -1787,7 +1787,7 @@ public static void Bar()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleSystemSortedUsings5(TestHost testHost)
Expand Down Expand Up @@ -1837,7 +1837,7 @@ public static void Bar()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
public Task TestSimpleSystemSortedUsings4(TestHost testHost)
Expand Down Expand Up @@ -1867,7 +1867,7 @@ void Method()
}
}
""",
testHost, options: Option(GenerationOptions.PlaceSystemNamespaceFirst, false));
testHost, options: Option(GenerationOptions.PlaceSystemNamespaceFirst, false));

[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538136")]
[WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538763")]
Expand Down Expand Up @@ -2166,8 +2166,8 @@ await TestAsync(

Expression
""",
GetScriptOptions(),
TestOptions.ReleaseDll.WithMetadataReferenceResolver(resolver));
GetScriptOptions(),
TestOptions.ReleaseDll.WithMetadataReferenceResolver(resolver));
}

[Theory, CombinatorialData]
Expand Down Expand Up @@ -2399,7 +2399,7 @@ static void Main(string[] args)
Log }
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
[WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/858085")]
Expand Down Expand Up @@ -4963,7 +4963,7 @@ public static void Bar()
}
}
""",
testHost);
testHost);

[Theory, CombinatorialData]
[WorkItem("https://github.com/dotnet/roslyn/issues/19796")]
Expand Down
Loading
Loading