Skip to content

Commit

Permalink
Keep leading underscores in generated identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Jan 22, 2024
1 parent cac83f4 commit 3fd2c50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Bonsai.Sgen/CSharpNamingConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ private CSharpNamingConvention()

public string Apply(string value)
{
return PascalCaseNamingConvention.Instance.Apply(value).Replace("_", string.Empty);
var result = PascalCaseNamingConvention.Instance.Apply(value);
var prefix = result.StartsWith('_') ? "_" : string.Empty;
return prefix + result.Replace("_", string.Empty);
}
}
}

0 comments on commit 3fd2c50

Please sign in to comment.