-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
50 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
Src/SyntaxFinder/ModifiersWalker.cs → Src/SyntaxFinder/Walkers/ModifiersWalker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Src/SyntaxFinder/Walkers/NestedConditionalExpressionsWalker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace SyntaxFinder.Walkers; | ||
|
||
using System.Collections.Concurrent; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.CSharp; | ||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
|
||
public class NestedConditionalExpressionsWalker(string file) : SyntaxFinderWalker(file) | ||
{ | ||
public static readonly ConcurrentDictionary<string, List<string>> MembersInType = new(); | ||
public static int Total; | ||
public static int Matching; | ||
|
||
public override void VisitConditionalExpression(ConditionalExpressionSyntax node) | ||
{ | ||
if (node.WhenTrue is ConditionalExpressionSyntax) | ||
{ | ||
this.WriteFilePath(); | ||
// this.WriteCode(node.Parent!); | ||
Interlocked.Increment(ref Total); | ||
} | ||
} | ||
|
||
public static void WriteResult() | ||
{ | ||
foreach (var entry in MembersInType) | ||
{ | ||
Console.WriteLine(entry.Key); | ||
foreach (var member in entry.Value.OrderBy(o => o)) | ||
{ | ||
Console.WriteLine(" " + member); | ||
} | ||
} | ||
|
||
ResultWriter.WriteMatching(Total, Matching); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
Src/SyntaxFinder/ObjectInitializerWalker.cs → ...Finder/Walkers/ObjectInitializerWalker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
Src/SyntaxFinder/SpreadWalker.cs → Src/SyntaxFinder/Walkers/SpreadWalker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters