Level 18
You can configure Pint to preserve your #region comments by customizing the single_line_comment_style rule. Create or modify your pint.json file:
{
"rules": {
"single_line_comment_style": {
"comment_types": ["asterisk"]
}
}
}
This tells Pint to only convert /* */ style comments to //, leaving # comments untouched.
Alternative approach (more targeted): If you want to keep most of Pint's comment formatting but just preserve regions:
{
"rules": {
"single_line_comment_style": false
}
}
This disables the rule entirely, so all your comment styles stay as-is.
Quick test:
#region Test Region
public function someMethod()
{
// This comment might still get formatted
/* This one too */
}
#endregion
The first option is probably what you want - it's minimal configuration that solves your specific use case while keeping Pint's other formatting benefits.