11import { ReactElement , useEffect , useRef , useState } from 'react'
2- import { createLanguageClientManager , LanguageClientId , StatusChangeEvent as WrapperStatusChangeEvent , LanguageClientManager , WillShutdownParams , Infrastructure , LanguageClientOptions } from '@codingame/monaco-languageclient-wrapper'
2+ import { createLanguageClientManager , LanguageClientId , StatusChangeEvent as WrapperStatusChangeEvent , LanguageClientManager , WillShutdownParams , Infrastructure , LanguageClientOptions , LanguageClientManagerOptions } from '@codingame/monaco-languageclient-wrapper'
33import useIsUserActive from './hooks/useIsUserActive'
44import useShouldShutdownLanguageClient from './hooks/useShouldShutdownLanguageClient'
55import { useLastVersion } from './hooks/useLastVersion'
@@ -12,6 +12,7 @@ export interface LanguageClientProps {
1212 id : LanguageClientId
1313 infrastructure : Infrastructure
1414 clientOptions ?: LanguageClientOptions
15+ clientManagerOptions ?: LanguageClientManagerOptions
1516 onError ?: ( error : Error ) => void
1617 onDidChangeStatus ?: ( status : StatusChangeEvent ) => void
1718 /** The language client will be shutdown by the server */
@@ -28,6 +29,7 @@ function LanguageClient ({
2829 id,
2930 infrastructure,
3031 clientOptions,
32+ clientManagerOptions,
3133 onError : _onError ,
3234 onDidChangeStatus : _onDidChangeStatus ,
3335 onWillShutdown : _onWillShutdown ,
@@ -66,7 +68,7 @@ function LanguageClient ({
6668 }
6769
6870 console . info ( `Starting language server for language ${ id } ` )
69- const languageClient = createLanguageClientManager ( id , infrastructure , clientOptions )
71+ const languageClient = createLanguageClientManager ( id , infrastructure , clientOptions , clientManagerOptions )
7072 languageClientRef . current = languageClient
7173 const errorDisposable = languageClient . onError ( onError )
7274 const statusChangeDisposable = languageClient . onDidChangeStatus ( onDidChangeStatus )
@@ -88,7 +90,7 @@ function LanguageClient ({
8890 console . error ( 'Unable to dispose language client' , err )
8991 } )
9092 }
91- } , [ id , counter , shouldShutdownLanguageClientForInactivity , onError , onDidChangeStatus , onWillShutdown , infrastructure , clientOptions ] )
93+ } , [ id , counter , shouldShutdownLanguageClientForInactivity , onError , onDidChangeStatus , onWillShutdown , infrastructure , clientOptions , clientManagerOptions ] )
9294
9395 return null
9496}
0 commit comments