Skip to content

Commit 3fb7c10

Browse files
committed
Microsoft.CodeAnalysis.CSharp updated.
Small fixes.
1 parent 7c6381b commit 3fb7c10

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

CSharpToJavaScript/CSharpToJavaScript.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0" />
22+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

CSharpToJavaScript/Walker.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class Walker : CSharpSyntaxWalker
1919
{
2020
public StringBuilder JSSB { get; set; } = new();
2121

22-
private CSTOJSOptions _Options = new();
22+
private readonly CSTOJSOptions _Options = new();
2323

2424
private SyntaxNode? _SNOriginal = null;
2525
private SyntaxNode? _BaseConstructorInitializerNode = null;
@@ -621,7 +621,7 @@ public override void VisitNameEquals(NameEqualsSyntax node)
621621
{
622622
case SyntaxKind.EqualsToken:
623623
{
624-
JSSB.Append(":");
624+
JSSB.Append(':');
625625
break;
626626
}
627627
default:
@@ -752,14 +752,14 @@ where n.AsNode().IsKind(SyntaxKind.PredefinedType)
752752

753753
FieldDeclarationSyntax field = null;
754754

755-
if (key.Count() == 0)
755+
if (!key.Any())
756756
{
757757
key = from n in nodesAndTokens
758758
where n.IsNode
759759
where n.AsNode().IsKind(SyntaxKind.IdentifierName)
760760
select n;
761761

762-
if (key.Count() == 0)
762+
if (!key.Any())
763763
{
764764
key = from n in nodesAndTokens
765765
where n.IsNode
@@ -979,7 +979,7 @@ where e.IsKind(SyntaxKind.IdentifierToken)
979979
}
980980
else
981981
{
982-
JSSB.Append($"\n");
982+
JSSB.AppendLine();
983983
SyntaxTriviaList _syntaxTrivias = asNode.Parent.Parent.GetLeadingTrivia();
984984

985985
for (int _i = 0; _i < _syntaxTrivias.Count; _i++)
@@ -1458,7 +1458,7 @@ public override void VisitInterpolatedStringExpression(InterpolatedStringExpress
14581458
break;
14591459
case SyntaxKind.Interpolation:
14601460
{
1461-
JSSB.Append("$");
1461+
JSSB.Append('$');
14621462
Visit(asNode);
14631463
break;
14641464
}
@@ -1476,7 +1476,7 @@ public override void VisitInterpolatedStringExpression(InterpolatedStringExpress
14761476
{
14771477
case SyntaxKind.InterpolatedStringStartToken:
14781478
case SyntaxKind.InterpolatedStringEndToken:
1479-
JSSB.Append("`");
1479+
JSSB.Append('`');
14801480
break;
14811481
default:
14821482
SM.Log($"asToken : {kind}");
@@ -1734,7 +1734,7 @@ where e.IsKind(SyntaxKind.IdentifierToken)
17341734

17351735
if (CustomCSNamesToJS(syntaxNode) == false)
17361736
{
1737-
JSSB.Append($" ");
1737+
JSSB.Append(' ');
17381738
if (BuiltInTypesGenerics(syntaxNode.WithoutLeadingTrivia(), iSymbol) == false)
17391739
{
17401740
SM.Log($"TODO : {syntaxNode} ||| USE 'CustomCSNamesToJS' TO CONVERT.");

0 commit comments

Comments
 (0)