Skip to content

Commit 53d239b

Browse files
committed
feat: Add clientOptions parameter
1 parent 1f24be5 commit 53d239b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/LanguageClient.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { 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'
33
import useIsUserActive from './hooks/useIsUserActive'
44
import useShouldShutdownLanguageClient from './hooks/useShouldShutdownLanguageClient'
55
import { useLastVersion } from './hooks/useLastVersion'
@@ -11,6 +11,7 @@ export interface StatusChangeEvent {
1111
export 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
2627
function 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

Comments
 (0)