11import { ReactElement , useEffect , useRef , useState } from 'react'
2- import { createLanguageClientManager , LanguageClientId , StatusChangeEvent as WrapperStatusChangeEvent , LanguageClientManager , WillShutdownParams , Infrastructure } from '@codingame/monaco-languageclient-wrapper'
2+ import { createLanguageClientManager , LanguageClientId , StatusChangeEvent as WrapperStatusChangeEvent , LanguageClientManager , WillShutdownParams , Infrastructure , LanguageClientOptions } from '@codingame/monaco-languageclient-wrapper'
33import useIsUserActive from './hooks/useIsUserActive'
44import useShouldShutdownLanguageClient from './hooks/useShouldShutdownLanguageClient'
55import { useLastVersion } from './hooks/useLastVersion'
@@ -11,6 +11,7 @@ export interface StatusChangeEvent {
1111export interface LanguageClientProps {
1212 id : LanguageClientId
1313 infrastructure : Infrastructure
14+ clientOptions ?: LanguageClientOptions
1415 onError ?: ( error : Error ) => void
1516 onDidChangeStatus ?: ( status : StatusChangeEvent ) => void
1617 /** The language client will be shutdown by the server */
@@ -26,6 +27,7 @@ const noop = () => null
2627function LanguageClient ( {
2728 id,
2829 infrastructure,
30+ clientOptions,
2931 onError : _onError ,
3032 onDidChangeStatus : _onDidChangeStatus ,
3133 onWillShutdown : _onWillShutdown ,
@@ -64,7 +66,7 @@ function LanguageClient ({
6466 }
6567
6668 console . info ( `Starting language server for language ${ id } ` )
67- const languageClient = createLanguageClientManager ( id , infrastructure )
69+ const languageClient = createLanguageClientManager ( id , infrastructure , clientOptions )
6870 languageClientRef . current = languageClient
6971 const errorDisposable = languageClient . onError ( onError )
7072 const statusChangeDisposable = languageClient . onDidChangeStatus ( onDidChangeStatus )
@@ -86,7 +88,7 @@ function LanguageClient ({
8688 console . error ( 'Unable to dispose language client' , err )
8789 } )
8890 }
89- } , [ id , counter , shouldShutdownLanguageClientForInactivity , onError , onDidChangeStatus , onWillShutdown , infrastructure ] )
91+ } , [ id , counter , shouldShutdownLanguageClientForInactivity , onError , onDidChangeStatus , onWillShutdown , infrastructure , clientOptions ] )
9092
9193 return null
9294}
0 commit comments