Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Datacute.IncrementalGeneratorExtensions" Version="1.0.0">
<PackageReference Include="Datacute.IncrementalGeneratorExtensions" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
10 changes: 6 additions & 4 deletions AdditionalTextConstantGenerator/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ protected override void AppendCustomMembers()

var additionalTextFileName = additionalTextFilePath.GetFileName();

Buffer.AppendFormatLines(Templates.StringConstantTemplate,
stringConstantName,
Buffer.AppendFormatLines(Templates.StringConstantDocCommentTemplate,
additionalTextFileName,
docCommentCode,
text.TextContent);
docCommentCode);

Buffer.AppendLine(string.Format(Templates.StringConstantTemplate,
stringConstantName,
text.TextContent));
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions AdditionalTextConstantGenerator/Templates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,18 @@ public AdditionalTextConstantsAttribute(string extension, string path)
/// </remarks>
";

public const string StringConstantTemplate = /* language=c# */
public const string StringConstantDocCommentTemplate = /* language=c# */
@"
/// <summary>Text value of the Additional Text: {1}</summary>
/// <summary>Text value of the Additional Text: {0}</summary>
/// <value>
/// <code>{2}
/// <code>{1}
/// </code>
/// </value>
public const string {0} = @""{3}"";
";

public const string StringConstantTemplate = /* language=c# */
@"public const string {0} = @""{1}"";";

public const string DesignTimeStringConstantTemplate = /* language=c# */
@"public const string {0} => ""Design Time"";";
}
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.2-alpha] - 2025-07-27

### Fixed
- Multi-line constants shouldn't be written with indenting

## [0.0.1-alpha] - 2025-07-27

### Added
- EmbeddedResourcePropertyGenerator code, converted to generate string constants for additional text files in a project

[Unreleased]: https://github.com/datacute/AdditionalTextConstantGenerator/compare/0.0.1-alpha...develop
[Unreleased]: https://github.com/datacute/AdditionalTextConstantGenerator/compare/0.0.2-alpha...develop
[0.0.2-alpha]: https://github.com/datacute/AdditionalTextConstantGenerator/releases/tag/0.0.2-alpha
[0.0.1-alpha]: https://github.com/datacute/AdditionalTextConstantGenerator/releases/tag/0.0.1-alpha
2 changes: 1 addition & 1 deletion version.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>0.0.1</VersionPrefix>
<VersionPrefix>0.0.2</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
Expand Down