Solution.Parser 2.0.13

This package has a SemVer 2.0.0 package version: 2.0.13+1.
dotnet add package Solution.Parser --version 2.0.13                
NuGet\Install-Package Solution.Parser -Version 2.0.13                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Solution.Parser" Version="2.0.13" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Solution.Parser --version 2.0.13                
#r "nuget: Solution.Parser, 2.0.13"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Solution.Parser as a Cake Addin
#addin nuget:?package=Solution.Parser&version=2.0.13

// Install Solution.Parser as a Cake Tool
#tool nuget:?package=Solution.Parser&version=2.0.13                

Solution Parser

Sample

 [TestClass]
 public abstract class MsTestBase
 {
     protected static IImmutableList<CSharpSyntaxTree> TestCode { get; private set; } = ImmutableList<CSharpSyntaxTree>.Empty;

     protected static IImmutableList<CSharpSyntaxTree> AllSyntaxTrees { get; private set; } = ImmutableList<CSharpSyntaxTree>.Empty;

     protected static IImmutableList<CSharpSyntaxTree> ProductiveCode { get; private set; } = ImmutableList<CSharpSyntaxTree>.Empty;

     protected static IImmutableList<CSharpSyntaxTree> ProductiveCodeToAnaylze { get; private set; } = ImmutableList<CSharpSyntaxTree>.Empty;

     protected static SolutionFile Solution { get; private set; } = null!;
      
     [AssemblyInitialize]
     public static void Init(TestContext _)
     {
         var sSolutionFileInfo = new SolutionFileName("MySolution.sln").FindSolutionFileReverseFrom(new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory));
         Throw.IfNull(sSolutionFileInfo);

         Solution = sSolutionFileInfo.Parse();

         ProductiveCode = Solution.ProductiveProjects.SelectMany(p => p.CSharpFileInfos)                                 
												     .Select(c => c.Parse())
												     .ToImmutableList();

         TestCode = Solution.UnitTestProjects.SelectMany(p => p.CSharpFileInfos)
											 .Select(c => c.Parse())
											 .ToImmutableList();

         AllSyntaxTrees = ProductiveCode.Concat(TestCode).ToImmutableList();        
     }
 }

CodeRule sample

[TestCategory("Coding-Rules")]
[TestCategory("Coding-Rules Records")]
[TestClass]
public class Records : MsTestBase // <-- MsTestBase is a base class that provides the ProductiveCode property
{
    [TestMethod]
    public void Record_Properties_Have_To_Be_Be_Immutable()
    {
        var mutableProperties = (from syntaxTree in ProductiveCode
                                 from @record in syntaxTree.Records
                                 from property in @record.Properties
                                 where property.IsReadOnly.IsFalse()
                                 select new
                                 {
                                     Error = $@"

Please do not use mutable properties
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FullName:  {@record.FullQualifiedName}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Property:  {property.Type} {property.Name}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Should be: {property.Type} {{get; init;}}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
"
                                    }).ToImmutableList();

        Assert.IsTrue(mutableProperties.IsEmpty(),
            $"Properties must be immutable. Findings: '{mutableProperties.Count}':{Environment.NewLine}{mutableProperties.Select(error => error.Error).Flatten(Environment.NewLine)}{Environment.NewLine}");
        }
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.13 1,307 6/12/2024
2.0.12 86 5/26/2024
2.0.11 1,036 5/12/2024
2.0.10 37 5/12/2024
2.0.9 38 5/10/2024
2.0.8 47 5/9/2024
2.0.7 35 5/9/2024
2.0.6 37 5/9/2024
2.0.5 1,440 4/20/2024
2.0.4 1,354 3/5/2024
2.0.3 2,765 1/22/2024
2.0.2 52 1/22/2024
2.0.1 404 1/16/2024
2.0.0 931 11/28/2023
0.2.0 443 11/28/2023
0.2.0-alpha.45 390 10/14/2023
0.2.0-alpha.44 103 9/12/2023
0.2.0-alpha.43 1,660 8/28/2023
0.2.0-alpha.42 86 8/27/2023
0.2.0-alpha.41 85 8/27/2023
0.2.0-alpha.38 1,375 7/25/2023
0.2.0-alpha.37 428 6/30/2023
0.2.0-alpha.34 4,859 3/16/2023
0.2.0-alpha.31 726 2/5/2023
0.2.0-alpha.30 2,363 1/2/2023
0.2.0-alpha.29 110 1/1/2023
0.2.0-alpha.27 93 1/1/2023
0.2.0-alpha.25 103 1/1/2023
0.1.0-alpha.24 96 12/27/2022
0.1.0-alpha.23 378 12/12/2022
0.1.0-alpha.22 92 12/12/2022
0.1.0-alpha.21 5,018 9/15/2022
0.1.0-alpha.19 187 9/14/2022
0.1.0-alpha.16 2,480 6/7/2022
0.1.0-alpha.15 120 6/7/2022
0.1.0-alpha.14 116 6/7/2022
0.1.0-alpha.13 332 4/25/2022
0.1.0-alpha.12 112 4/22/2022
0.1.0-alpha.11 134 4/16/2022

Fix parmaeters since .Net introducing primary constructors