diff --git a/MonacoEditorComponent/CodeEditor/CodeEditor.Methods.cs b/MonacoEditorComponent/CodeEditor/CodeEditor.Methods.cs
index 94c4be8..6674b35 100644
--- a/MonacoEditorComponent/CodeEditor/CodeEditor.Methods.cs
+++ b/MonacoEditorComponent/CodeEditor/CodeEditor.Methods.cs
@@ -11,7 +11,7 @@ namespace Monaco
///
/// Action delegate for and .
///
- public delegate void CommandHandler([ReadOnlyArray] string[] parameters);
+ public delegate void CommandHandler([ReadOnlyArray] object[] parameters);
///
/// This file contains Monaco IEditor method implementations we can call on our control.
@@ -122,7 +122,23 @@ namespace Monaco
public IAsyncOperation AddCommandAsync(int keybinding, CommandHandler handler, string context)
{
var name = "Command" + keybinding;
- _parentAccessor.RegisterActionWithParameters(name, (parameters) => { handler?.Invoke(parameters); });
+ _parentAccessor.RegisterActionWithParameters(name, (parameters) =>
+ {
+ if (parameters != null && parameters.Length > 0)
+ {
+ object[] args = new object[parameters.Length];
+ for (int i = 0; i < parameters.Length; i++)
+ {
+ args[i] = JsonConvert.DeserializeObject