Skip to content

Commit 044c84b

Browse files
committed
Remove INameTrimmer.Version
This no longer makes sense to keep and enabling features by baseline version seems fiddly. If we need to toggle features for newer versions, we can explicitly add a boolean config option.
1 parent e0fb52e commit 044c84b

5 files changed

Lines changed: 4 additions & 39 deletions

File tree

sources/SilkTouch/SilkTouch/Mods/PrettifyNames.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,9 +1449,6 @@ private NameAffixConfiguration GetConfiguration(string category) =>
14491449
/// </summary>
14501450
private class NameAffixerEarlyTrimmer(PrettifyNamesAffixer affixer) : INameTrimmer
14511451
{
1452-
/// <inheritdoc/>
1453-
public Version Version => new(3, 0);
1454-
14551452
public void Trim(NameTrimmerContext context)
14561453
{
14571454
if (context.Container == null)
@@ -1482,9 +1479,6 @@ public void Trim(NameTrimmerContext context)
14821479

14831480
private class PrettifyNamesTrimmer(NamePrettifier namePrettifier) : INameTrimmer
14841481
{
1485-
/// <inheritdoc/>
1486-
public Version Version => new(3, 0);
1487-
14881482
public void Trim(NameTrimmerContext context)
14891483
{
14901484
foreach (var (original, (primary, secondary)) in context.Names)
@@ -1514,9 +1508,6 @@ public void Trim(NameTrimmerContext context)
15141508
/// </summary>
15151509
private class NameAffixerLateTrimmer(PrettifyNamesAffixer affixer) : INameTrimmer
15161510
{
1517-
/// <inheritdoc/>
1518-
public Version Version => new(3, 0);
1519-
15201511
public void Trim(NameTrimmerContext context)
15211512
{
15221513
if (context.Container == null)

sources/SilkTouch/SilkTouch/Naming/INameTrimmer.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@
55
/// </summary>
66
public interface INameTrimmer
77
{
8-
/// <summary>
9-
/// Gets the name trimmer version i.e. the Silk.NET version that introduced this name trimming method. This is so
10-
/// new bindings released with or after this version don't have to have older trimming methods executed (the name
11-
/// version can be specified in the mod configuration)
12-
/// </summary>
13-
Version Version { get; }
14-
158
/// <summary>
169
/// Trims prefixes from the given constituent names within the given container.
1710
/// </summary>
1811
/// <param name="context">The arguments.</param>
19-
void Trim(NameTrimmerContext context);
12+
public void Trim(NameTrimmerContext context);
2013
}

sources/SilkTouch/SilkTouch/Naming/NameTrimmer.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Diagnostics;
4-
using System.Linq;
5-
using System.Text.Json;
6-
7-
namespace Silk.NET.SilkTouch.Naming;
1+
namespace Silk.NET.SilkTouch.Naming;
82

93
/// <summary>
104
/// The default name trimmer ported from Silk.NET 2.18 with modifications for 3.0.
115
/// </summary>
126
public class NameTrimmer : INameTrimmer
137
{
14-
/// <inheritdoc />
15-
public virtual Version Version => new(3, 0);
16-
178
/// <summary>
189
/// Determines whether a second pass without using <see cref="GetTrimmingName"/> is warranted.
1910
/// </summary>

sources/SilkTouch/SilkTouch/Naming/NameTrimmer217.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using Humanizer;
1+
using Humanizer;
42

53
namespace Silk.NET.SilkTouch.Naming;
64

@@ -10,9 +8,6 @@ namespace Silk.NET.SilkTouch.Naming;
108
[Obsolete("Use NameTrimmer instead for 3.0 names")]
119
public class NameTrimmer217 : NameTrimmer
1210
{
13-
/// <inheritdoc />
14-
public override Version Version => new(2, 17);
15-
1611
/// <inheritdoc />
1712
protected override bool HasRawPass => false;
1813

sources/SilkTouch/SilkTouch/Naming/NameTrimmer218.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
using System;
2-
3-
namespace Silk.NET.SilkTouch.Naming;
1+
namespace Silk.NET.SilkTouch.Naming;
42

53
/// <summary>
64
/// The 2.18 name trimmer.
75
/// </summary>
86
[Obsolete("Use NameTrimmer instead for 3.0 names")]
97
public class NameTrimmer218 : NameTrimmer
108
{
11-
/// <inheritdoc />
12-
public override Version Version => new(2, 18);
13-
149
/// <inheritdoc />
1510
protected override bool HasRawPass => false;
1611

0 commit comments

Comments
 (0)