Apply consistent method parameter line break formatting across all C# projects in the repository.
Applies consistent line break formatting to method parameter declarations across C# projects.
/plugin marketplace add atc-net/atc-agentic-toolkit/plugin install code-refactoring@atc-netApply consistent method parameter line break formatting across all C# projects in the repository.
ALL projects:
All *.cs files EXCEPT auto-generated code. Exclude files with:
ONLY format parameter lists in DECLARATIONS:
DO NOT format parameter lists in INVOCATIONS or EXPRESSIONS:
.Replace(...), .Substring(...))new MyClass(...))condition ? value1 : value2)(x, y) => x + y)this[int x, int y])Break down all parameters if a method has more than 1 parameter, with each parameter on its own line.
Break down a single parameter if the total line length (including indentation) exceeds 80 characters.
// No parameters - no break
public void MyMethod1()
// Single short parameter - no break
public void MyMethod2(int parameter1)
// Single parameter, method name long but total < 80 chars - no break
public void MyLoooooooooooooooooooooooooooooooooooooooonMethod3(int parameter1)
// Single parameter, total length > 80 chars - break
public void MyLooooooooooooooooooooooooooooooooooooooooooonMethod4(
int parameter1)
// 2 parameters - break all
public void MyMethod5(
int parameter1,
int parameter2)
// 3+ parameters - break all
public void MyMethod6(
int parameter1,
int parameter2,
int parameter3)
// Single parameter - no break
public MyClass(string name)
// Multiple parameters - break all
public MyClass(
string name,
int age,
bool isActive)
public void OuterMethod()
{
// Local function with multiple parameters - break all
void LocalFunction(
int param1,
string param2)
{
// implementation
}
}
// Multiple parameters - break all
public delegate void MyEventHandler(
object sender,
EventArgs e);
// Single parameter - no break
public delegate void SimpleHandler(string message);
These should remain unchanged - do not modify invocations or expressions:
// ❌ Method invocations - DO NOT format these
var result = assembly.GetBeautifiedName().Replace("Api", "API", StringComparison.Ordinal);
var name = someObject.SomeMethod(arg1, arg2, arg3);
// ❌ Constructor invocations - DO NOT format these
var obj = new MyClass(param1, param2, param3);
// ❌ Ternary operators - DO NOT format these
return condition ? value1 : value2;
return removeLastVerb
? assemblyName.Substring(0, assemblyName.LastIndexOf(' '))
: assemblyName;
// ❌ Lambda expressions - DO NOT format these
var filtered = items.Where((item, index) => item.IsActive && index > 0);
// ❌ LINQ expressions - DO NOT format these
var query = from item in items
where item.IsActive
select new { item.Name, item.Value };
// ❌ Indexer declarations - DO NOT format these
public string this[int row, int column]
{
get => matrix[row, column];
}
Find all .cs files in the repository
Look for these patterns to identify declarations:
Method declarations:
public, private, protected, internalstatic, virtual, override, abstract, async, sealed[modifiers] [return-type] [method-name]([parameters])void) before the method name{, ;, or =>Constructor declarations:
[modifiers] [class-name]([parameters])Local function declarations:
[return-type] [function-name]([parameters])Delegate declarations:
[modifiers] delegate [return-type] [delegate-name]([parameters]);delegate keywordKey distinction from invocations:
. (member access), are on the right side of =, or are arguments to other methodsFor each declaration found:
( on same line as method name) on same line as last parameterWork on files in manageable batches (e.g., 10-20 files at a time)
Run dotnet build to ensure no syntax errors
Use todo list to track which files have been processed
Run full test suite after all changes complete
public void MyMethod(int x, int y) // Method declaration
private async Task<string> GetDataAsync(string id) // Async method declaration
protected virtual bool TryParse(string input, out int result) // Virtual method with out param
internal static MyClass Create(string name, int age) // Static method declaration
public MyClass(string name, int age) // Constructor declaration
delegate void EventHandler(object sender, EventArgs e) // Delegate declaration
void LocalFunc(int a, int b) // Local function (inside a method)
{
// ...
}
var result = MyMethod(x, y); // Method invocation
var name = assembly.GetName().Replace("old", "new", StringComparison.Ordinal); // Chained invocations
var obj = new MyClass(name, age); // Constructor invocation
return condition ? value1 : value2; // Ternary operator
var lambda = (int x, int y) => x + y; // Lambda expression
items.Where((item, index) => item.IsActive) // Lambda in method call
var value = this[row, column]; // Indexer usage