From 9193dbd0cca7fcafb189d17e3f619e4c92d066d3 Mon Sep 17 00:00:00 2001 From: ovalnine Date: Sat, 17 May 2025 12:40:35 -0700 Subject: [PATCH] Fix reflection invocation of PdeLanguageServer Fixed argument type mismatch when invoking the PdeLanguageServer main method via reflection. Changed from using spread operator with a list wrapper to passing a properly typed String array directly. This resolves the IllegalArgumentException thrown during language server initialization. --- app/src/processing/app/Processing.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/Processing.kt b/app/src/processing/app/Processing.kt index 11555edf5..02465c8b5 100644 --- a/app/src/processing/app/Processing.kt +++ b/app/src/processing/app/Processing.kt @@ -52,7 +52,7 @@ class LSP: SuspendingCliktCommand("lsp"){ // Indirect invocation since app does not depend on java mode Class.forName("processing.mode.java.lsp.PdeLanguageServer") .getMethod("main", Array::class.java) - .invoke(null, *arrayOf(emptyList())) + .invoke(null, arrayOf()) } catch (e: Exception) { throw InternalError("Failed to invoke main method", e) } @@ -87,4 +87,4 @@ class LegacyCLI(val args: Array): SuspendingCliktCommand( "cli"){ throw InternalError("Failed to invoke main method", e) } } -} \ No newline at end of file +}