diff --git a/src/components/problem-editor.tsx b/src/components/problem-editor.tsx index 5c1fba7..118f123 100644 --- a/src/components/problem-editor.tsx +++ b/src/components/problem-editor.tsx @@ -32,6 +32,7 @@ export function ProblemEditor() { hydrated, editor, setEditor, + setMarkers, setWebSocket, currentLang, currentPath, @@ -113,6 +114,13 @@ export function ProblemEditor() { [changeValue] ); + const handleEditorValidation = useCallback( + (markers: editor.IMarker[]) => { + setMarkers(markers); + }, + [setMarkers] + ); + if (!hydrated) { return ; } @@ -126,6 +134,7 @@ export function ProblemEditor() { beforeMount={handleEditorWillMount} onMount={handleOnMount} onChange={handleEditorChange} + onValidate={handleEditorValidation} options={DefaultEditorOptionConfig} loading={} className="h-full w-full py-2"