11import React , { ForwardedRef , forwardRef , ReactElement , useEffect , useMemo , useRef , useState } from 'react'
22import debounce from 'lodash.debounce'
33import { monaco , createEditor , getMonacoLanguage , updateEditorKeybindingsMode , registerEditorOpenHandler } from '@codingame/monaco-editor-wrapper'
4+ import { IEditorOptions } from 'vscode/service-override/modelEditor'
45import { useDeepMemo , useLastValueRef , useLastVersion , useThemeData , useUserConfiguration } from './hooks'
56import './style'
67
@@ -92,7 +93,7 @@ export interface MonacoEditorProps {
9293 *
9394 * Default is opening a new editor in a popup
9495 */
95- onEditorOpenRequest ?: ( model : monaco . editor . ITextModel , input : monaco . extra . IResourceEditorInput , source : monaco . editor . ICodeEditor , sideBySide ?: boolean ) => Promise < monaco . editor . ICodeEditor | null >
96+ onEditorOpenRequest ?: ( model : monaco . editor . ITextModel , options : IEditorOptions | undefined , source : monaco . editor . ICodeEditor , sideBySide ?: boolean ) => Promise < monaco . editor . ICodeEditor | null >
9697}
9798
9899function MonacoEditor ( {
@@ -166,6 +167,7 @@ function MonacoEditor ({
166167 modelRef . current = undefined
167168 editorRef . current ?. setModel ( null )
168169 }
170+ return undefined
169171 } , [ monacoLanguage , modelUri , valueRef , lastSaveViewState , lastRestoreViewState ] )
170172
171173 // Create editor
@@ -207,6 +209,7 @@ function MonacoEditor ({
207209 editor . dispose ( )
208210 }
209211 }
212+ return undefined
210213 // eslint-disable-next-line react-hooks/exhaustive-deps
211214 } , [ ] )
212215
@@ -260,6 +263,7 @@ function MonacoEditor ({
260263 monaco . editor . setModelMarkers ( model , 'customMarkers' , [ ] )
261264 }
262265 }
266+ return undefined
263267 } , [ markers ] )
264268
265269 // Call onChange callback
@@ -275,6 +279,7 @@ function MonacoEditor ({
275279 didChangeModelContentDisposable . dispose ( )
276280 }
277281 }
282+ return undefined
278283 } , [ onChange ] )
279284
280285 useEffect ( ( ) => {
@@ -289,6 +294,7 @@ function MonacoEditor ({
289294 disposable . dispose ( )
290295 }
291296 }
297+ return undefined
292298 } , [ onEditorOpenRequest ] )
293299
294300 // Compute height
0 commit comments