Skip to content

Commit

Permalink
feat: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Rain120 committed Sep 11, 2024
1 parent 86656e1 commit 615f479
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const Editor = React.forwardRef(

const handleFormatDocument = React.useCallback(() => {
if (editorRef.current) {
console.log('editorRef.current12312', editorRef.current);
// @ts-ignore
editorRef.current?.getAction?.('editor.action.formatDocument').run();
}
Expand All @@ -93,9 +92,12 @@ const Editor = React.forwardRef(
}, [editorRef.current]);

const handleEditorDidMount = React.useCallback((editor: EditorType) => {
// @ts-ignore
editorRef.current = editor;

// @ts-ignore
editor.handleFormatDocument = handleFormatDocument;
// @ts-ignore
editor.getLanguage = getLanguage;

setEditor(editor);
Expand Down

0 comments on commit 615f479

Please sign in to comment.