Closed HillPhelmuth closed 3 years ago
Hi @HillPhelmuth Thanks a lot for pointing this out. As you've said, it's not convenient to create a useless JsonElement instance. So, I've changed this parameter to an Object which can be of anytype and nullable. This change is now available in v2.1.0
I've created a custom c# code completion provider and created an action to trigger it manually. This requires using Monaco's
editor.trigger
function. However, the interop method makes this sort of awkward sinceJsonElement
isn't really designed to be used outside of aJsonDocument
. I've made this work by directly invoking yourblazorMonaco.editor.trigger
javascript function.private async Task Suggest() => await Js.InvokeVoidAsync("blazorMonaco.editor.trigger", _editor.Id, "whatever...", "editor.action.triggerSuggest", "whatever...");
While this isn't particularly burdensome, I think it would be good to offer an overload of the Trigger method that takes a string or object instead of a
JsonElement
for the payload, particularly since the payload doesn't require a meaningful value for many of Monaco's triggered functions.If you agree, I'd be happy to submit a pull-request to this effect.