How should I add JS custom class hints?
@using MudBlazor;
@using WorkflowCore.Activities;
@using WorkflowCore.Attributes;
@using WorkflowCore.Models;
@using WorkflowCore.Workflows;
@using BlazorMonaco;
<MonacoEditor @ref="@Editor" ModelMarkers="" ConstructionOptions="@EditorConstructionOptions" OnDidChangeModelContent="@OnDidChangeModelContent" />
private StandaloneEditorConstructionOptions EditorConstructionOptions(MonacoEditor codeEditor)
{
return new StandaloneEditorConstructionOptions
{
Language = Language,
Value = Code,
Minimap = new EditorMinimapOptions() { Enabled = false },
};
}
I can create the editor and it works fine, but I want to add custom classes, custom global variables. However, no relevant resources were found, including asking about GPT, but there was still no answer.
await JSRuntime.InvokeVoidAsync("monaco.languages.typescript.javascriptDefaults.addExtraLib", GenerateJSDeclareString(), null);
GenerateJSDeclareString() is string, like:
/**
* XXXX
*/
declare class ConditionModel {
/**
* XXXX
*/
Condition:boolean
}
This is not yet supported by BlazorMonaco but you can have your custom javascript file and make that call in javascript instead. You can access the js editor instance using the window.blazorMonaco.editor.getEditor(id) javascript method.
@serdarciplak Is there any plan to support this feature?