File tree Expand file tree Collapse file tree 6 files changed +18
-15
lines changed
CodeAnalysis.SourceBuilder Expand file tree Collapse file tree 6 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 2323 uses : actions/setup-dotnet@v4
2424 with :
2525 dotnet-version : |
26- 8 .0.x
26+ 9 .0.x
2727
2828 # Create Local NuGet Source
2929
Original file line number Diff line number Diff line change 1616 <RepositoryUrl >https://github.com/pfpack/early-codeanalysis</RepositoryUrl >
1717 <Company >pfpack</Company >
1818 <Authors >Andrei Sergeev, Pavel Moskovoy</Authors >
19- <Copyright >Copyright © 2024 Andrei Sergeev, Pavel Moskovoy</Copyright >
19+ <Copyright >Copyright © 2025 Andrei Sergeev, Pavel Moskovoy</Copyright >
2020 <Description >EarlyFuncPack CodeAnalysis is a library for .NET for use in building source generators.</Description >
2121 <RootNamespace >PrimeFuncPack</RootNamespace >
2222 <AssemblyName >EarlyFuncPack.CodeAnalysis.Extensions</AssemblyName >
23- <Version >0.0.1-build.1 </Version >
23+ <Version >0.0.1</Version >
2424 </PropertyGroup >
2525
2626 <ItemGroup >
3939 </ItemGroup >
4040
4141 <ItemGroup >
42- <PackageReference Include =" Microsoft.CodeAnalysis" Version =" 4.10 .0" />
42+ <PackageReference Include =" Microsoft.CodeAnalysis.CSharp " Version =" 4.13 .0" />
4343 </ItemGroup >
4444
4545</Project >
Original file line number Diff line number Diff line change 22
33namespace PrimeFuncPack ;
44
5- public sealed record class DisplayedTypeData
5+ public sealed class DisplayedTypeData
66{
77 public DisplayedTypeData ( IReadOnlyCollection < string > allNamespaces , string displayedTypeName )
88 {
Original file line number Diff line number Diff line change 1616 <RepositoryUrl >https://github.com/pfpack/early-codeanalysis</RepositoryUrl >
1717 <Company >pfpack</Company >
1818 <Authors >Andrei Sergeev, Pavel Moskovoy</Authors >
19- <Copyright >Copyright © 2024 Andrei Sergeev, Pavel Moskovoy</Copyright >
19+ <Copyright >Copyright © 2025 Andrei Sergeev, Pavel Moskovoy</Copyright >
2020 <Description >EarlyFuncPack CodeAnalysis is a library for .NET for use in building source generators.</Description >
2121 <RootNamespace >PrimeFuncPack</RootNamespace >
2222 <AssemblyName >EarlyFuncPack.CodeAnalysis.SourceBuilder</AssemblyName >
23- <Version >0.0.1-build.1 </Version >
23+ <Version >0.0.1</Version >
2424 </PropertyGroup >
2525
2626 <ItemGroup >
Original file line number Diff line number Diff line change @@ -8,10 +8,9 @@ partial class SourceBuilder
88{
99 public string Build ( )
1010 {
11- var builder = new StringBuilder ( "// Auto-generated code" ) ;
12- builder = builder . AppendLine ( ) . Append ( "#nullable enable" ) ;
11+ var builder = new StringBuilder ( "// Auto-generated code by PrimeFuncPack" ) . AppendLine ( ) . Append ( "#nullable enable" ) ;
1312
14- if ( usings . Count is not > 0 )
13+ if ( usings . Count > 0 )
1514 {
1615 builder = builder . AppendLine ( ) ;
1716 }
@@ -23,7 +22,7 @@ public string Build()
2322
2423 builder = builder . AppendLine ( ) . AppendLine ( ) . Append ( "namespace" ) . Append ( ' ' ) . Append ( @namespace ) . Append ( ';' ) ;
2524
26- if ( aliases . Count is not > 0 )
25+ if ( aliases . Count > 0 )
2726 {
2827 builder = builder . AppendLine ( ) ;
2928 }
Original file line number Diff line number Diff line change @@ -23,14 +23,18 @@ public SourceBuilder(string? @namespace)
2323
2424 private SourceBuilder InnerAppendLineWithTabulation ( string codeLine )
2525 {
26- if ( tabulationSize is not > 0 )
26+ if ( codeBuilder . Length > 0 )
2727 {
28- return this ;
28+ _ = codeBuilder . AppendLine ( ) ;
2929 }
3030
31- var tabulation = new string ( ' ' , TabulationLength * tabulationSize ) ;
32- _ = codeBuilder . AppendLine ( ) . Append ( tabulation ) . Append ( codeLine ) ;
31+ if ( tabulationSize > 0 )
32+ {
33+ var tabulation = new string ( ' ' , TabulationLength * tabulationSize ) ;
34+ _ = codeBuilder . Append ( tabulation ) ;
35+ }
3336
37+ _ = codeBuilder . Append ( codeLine ) ;
3438 return this ;
3539 }
3640}
You can’t perform that action at this time.
0 commit comments