Skip to content

Commit

Permalink
Bump to Roslyn 4.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed Sep 15, 2023
1 parent e08d89d commit 003d097
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 1 addition & 5 deletions src/Quoter.Tests/Quoter.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<IncludeAssets>runtime;build;native;contentFiles;analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Quoter\Quoter.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}"></Service>
</ItemGroup>

</Project>
8 changes: 6 additions & 2 deletions src/Quoter.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public void TestUsingSystemWithRedundantCalls()
SyntaxFactory.IdentifierName(""System""))
.WithUsingKeyword(
SyntaxFactory.Token(SyntaxKind.UsingKeyword))
.WithNamespaceOrType(
SyntaxFactory.IdentifierName(""System""))
.WithSemicolonToken(
SyntaxFactory.Token(SyntaxKind.SemicolonToken))))
.WithEndOfFileToken(
Expand Down Expand Up @@ -173,6 +175,8 @@ static void Main(string[] args)
SyntaxFactory.IdentifierName(""System""))
.WithUsingKeyword(
SyntaxFactory.Token(SyntaxKind.UsingKeyword))
.WithNamespaceOrType(
SyntaxFactory.IdentifierName(""System""))
.WithSemicolonToken(
SyntaxFactory.Token(SyntaxKind.SemicolonToken))))
.WithMembers(
Expand Down Expand Up @@ -910,7 +914,7 @@ private static void Test(
Assert.Equal(sourceText, resultText);
}

public void CheckSourceFiles()
internal void CheckSourceFiles()
{
var rootFolder = @"C:\roslyn-internal\Closed\Test\Files\";
var files = Directory.GetFiles(rootFolder, "*.cs", SearchOption.AllDirectories);
Expand All @@ -920,7 +924,7 @@ public void CheckSourceFiles()
}
}

public void VerifyRoundtrip(string file)
internal void VerifyRoundtrip(string file)
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion src/Quoter.Web/Quoter.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions src/Quoter/Quoter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,14 +638,14 @@ private ApiCall QuoteTrivia(SyntaxTrivia syntaxTrivia)
string factoryMethodName = SyntaxFactoryMethod("Trivia");
string text = syntaxTrivia.ToString();
if (syntaxTrivia.FullSpan.Length == 0 ||
(syntaxTrivia.Kind() == SyntaxKind.WhitespaceTrivia && UseDefaultFormatting))
(syntaxTrivia.IsKind(SyntaxKind.WhitespaceTrivia) && UseDefaultFormatting))
{
return null;
}

PropertyInfo triviaFactoryProperty = null;
if (triviaFactoryProperties.TryGetValue(syntaxTrivia.ToString(), out triviaFactoryProperty) &&
((SyntaxTrivia)triviaFactoryProperty.GetValue(null)).Kind() == syntaxTrivia.Kind())
((SyntaxTrivia)triviaFactoryProperty.GetValue(null)).IsKind(syntaxTrivia.Kind()))
{
if (UseDefaultFormatting)
{
Expand All @@ -657,7 +657,7 @@ private ApiCall QuoteTrivia(SyntaxTrivia syntaxTrivia)

if (!string.IsNullOrEmpty(text) &&
string.IsNullOrWhiteSpace(text) &&
syntaxTrivia.Kind() == SyntaxKind.WhitespaceTrivia)
syntaxTrivia.IsKind(SyntaxKind.WhitespaceTrivia))
{
if (UseDefaultFormatting)
{
Expand All @@ -667,23 +667,23 @@ private ApiCall QuoteTrivia(SyntaxTrivia syntaxTrivia)
factoryMethodName = SyntaxFactoryMethod("Whitespace");
}

if (syntaxTrivia.Kind() == SyntaxKind.SingleLineCommentTrivia ||
syntaxTrivia.Kind() == SyntaxKind.MultiLineCommentTrivia)
if (syntaxTrivia.IsKind(SyntaxKind.SingleLineCommentTrivia) ||
syntaxTrivia.IsKind(SyntaxKind.MultiLineCommentTrivia))
{
factoryMethodName = SyntaxFactoryMethod("Comment");
}

if (syntaxTrivia.Kind() == SyntaxKind.PreprocessingMessageTrivia)
if (syntaxTrivia.IsKind(SyntaxKind.PreprocessingMessageTrivia))
{
factoryMethodName = SyntaxFactoryMethod("PreprocessingMessage");
}

if (syntaxTrivia.Kind() == SyntaxKind.DisabledTextTrivia)
if (syntaxTrivia.IsKind(SyntaxKind.DisabledTextTrivia))
{
factoryMethodName = SyntaxFactoryMethod("DisabledText");
}

if (syntaxTrivia.Kind() == SyntaxKind.DocumentationCommentExteriorTrivia)
if (syntaxTrivia.IsKind(SyntaxKind.DocumentationCommentExteriorTrivia))
{
factoryMethodName = SyntaxFactoryMethod("DocumentationCommentExterior");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Quoter/Quoter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.7.0" />
</ItemGroup>

</Project>

0 comments on commit 003d097

Please sign in to comment.