Skip to content

Commit 80d0f6c

Browse files
committed
Update docs for TransformProperties to prepare for my boolean transformation change
1 parent 133c257 commit 80d0f6c

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

sources/SilkTouch/SilkTouch/Mods/TransformProperties.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
using System.Threading;
6-
using System.Threading.Tasks;
74
using Microsoft.CodeAnalysis;
85
using Microsoft.CodeAnalysis.CSharp;
96
using Microsoft.CodeAnalysis.CSharp.Syntax;
@@ -12,11 +9,18 @@
129
namespace Silk.NET.SilkTouch.Mods;
1310

1411
/// <summary>
15-
/// Applies transformations to property signatures.
12+
/// Applies transformations to fields and properties.
1613
/// </summary>
1714
/// <remarks>
18-
/// Today, this only includes transforming properties like <c>static ReadOnlySpan&lt;byte&gt; Thing => "thing"u8;</c>
19-
/// to be <c>static Utf8String Thing => "thing"u8;</c>.
15+
/// Despite the name of the name, fields are also handled here because
16+
/// they often need to be transformed alongside properties.
17+
/// <para/>
18+
/// This currently does the following changes:
19+
/// 1. Transform string constant properties like
20+
/// <c>static ReadOnlySpan&lt;byte&gt; Thing => "thing"u8;</c> to be
21+
/// <c>static Utf8String Thing => "thing"u8;</c>.
22+
/// 2. Transform fields and properties that are recognised
23+
/// to be akin to booleans to use the <c>MaybeBool</c> type.
2024
/// </remarks>
2125
public class TransformProperties : IMod
2226
{
@@ -48,7 +52,7 @@ private class Rewriter : CSharpSyntaxRewriter
4852
is GenericNameSyntax
4953
{
5054
TypeArgumentList.Arguments: [PredefinedTypeSyntax pt],
51-
Identifier.Text: "ReadOnlySpan"
55+
Identifier.Text: "ReadOnlySpan",
5256
}
5357
&& (
5458
pt.Keyword.IsKind(SyntaxKind.ByteKeyword)

0 commit comments

Comments
 (0)