1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-19 11:46:07 +02:00
git/t/t4018/csharp-exclude-method-calls
Steven Jeuris ec0e3075d2 userdiff: better method/property matching for C#
- Support multi-line methods by not requiring closing parenthesis.
- Support multiple generics (comma was missing before).
- Add missing `foreach`, `lock` and  `fixed` keywords to skip over.
- Remove `instanceof` keyword, which isn't C#.
- Also detect non-method keywords not positioned at the start of a line.
- Added tests; none existed before.

The overall strategy is to focus more on what isn't expected for
method/property definitions, instead of what is, but is fully optional.

Signed-off-by: Steven Jeuris <steven.jeuris@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-04-05 15:21:43 -07:00

21 lines
353 B
Plaintext

class Example
{
string Method(int RIGHT)
{
MethodCall();
MethodCall(1, 2);
MethodCall(
1, 2);
MethodCall(
1, 2,
3);
MethodCall(
1, MethodCall(),
2);
return "ChangeMe";
}
int MethodCall(int a = 0, int b = 0, int c = 0) => 42;
}