aboutsummaryrefslogtreecommitdiffstats
path: root/t/t4018/csharp-exclude-generic-method-calls
diff options
context:
space:
mode:
authorSteven Jeuris <steven.jeuris@3shape.com>2024-04-03 21:42:44 +0000
committerJunio C Hamano <gitster@pobox.com>2024-04-05 15:21:43 -0700
commitec0e3075d245afa3f3a848bd7bdc6376dea85fe0 (patch)
tree9e42f695fbf945e39678245e0092b5f2a125fe3c /t/t4018/csharp-exclude-generic-method-calls
parent43072b4ca132437f21975ac6acc6b72dc22fd398 (diff)
downloadgit-ec0e3075d245afa3f3a848bd7bdc6376dea85fe0.tar.gz
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>
Diffstat (limited to 't/t4018/csharp-exclude-generic-method-calls')
-rw-r--r--t/t4018/csharp-exclude-generic-method-calls12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t4018/csharp-exclude-generic-method-calls b/t/t4018/csharp-exclude-generic-method-calls
new file mode 100644
index 0000000000..31af546665
--- /dev/null
+++ b/t/t4018/csharp-exclude-generic-method-calls
@@ -0,0 +1,12 @@
+class Example
+{
+ string Method(int RIGHT)
+ {
+ GenericMethodCall<int, int>(
+ );
+
+ return "ChangeMe";
+ }
+
+ string GenericMethodCall<T, T2>() => "test";
+}