1
1
import { 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'
3
3
import useIsUserActive from './hooks/useIsUserActive'
4
4
import useShouldShutdownLanguageClient from './hooks/useShouldShutdownLanguageClient'
5
5
import { useLastVersion } from './hooks/useLastVersion'
@@ -12,6 +12,7 @@ export interface LanguageClientProps {
12
12
id : LanguageClientId
13
13
infrastructure : Infrastructure
14
14
clientOptions ?: LanguageClientOptions
15
+ clientManagerOptions ?: LanguageClientManagerOptions
15
16
onError ?: ( error : Error ) => void
16
17
onDidChangeStatus ?: ( status : StatusChangeEvent ) => void
17
18
/** The language client will be shutdown by the server */
@@ -28,6 +29,7 @@ function LanguageClient ({
28
29
id,
29
30
infrastructure,
30
31
clientOptions,
32
+ clientManagerOptions,
31
33
onError : _onError ,
32
34
onDidChangeStatus : _onDidChangeStatus ,
33
35
onWillShutdown : _onWillShutdown ,
@@ -66,7 +68,7 @@ function LanguageClient ({
66
68
}
67
69
68
70
console . info ( `Starting language server for language ${ id } ` )
69
- const languageClient = createLanguageClientManager ( id , infrastructure , clientOptions )
71
+ const languageClient = createLanguageClientManager ( id , infrastructure , clientOptions , clientManagerOptions )
70
72
languageClientRef . current = languageClient
71
73
const errorDisposable = languageClient . onError ( onError )
72
74
const statusChangeDisposable = languageClient . onDidChangeStatus ( onDidChangeStatus )
@@ -88,7 +90,7 @@ function LanguageClient ({
88
90
console . error ( 'Unable to dispose language client' , err )
89
91
} )
90
92
}
91
- } , [ id , counter , shouldShutdownLanguageClientForInactivity , onError , onDidChangeStatus , onWillShutdown , infrastructure , clientOptions ] )
93
+ } , [ id , counter , shouldShutdownLanguageClientForInactivity , onError , onDidChangeStatus , onWillShutdown , infrastructure , clientOptions , clientManagerOptions ] )
92
94
93
95
return null
94
96
}
0 commit comments