Skip to content

Commit 320b4f0

Browse files
authored
Merge pull request #13 from CodinGame/feat-add-manager-options
[FEAT] Add manager options to component props
2 parents b81ecf6 + ae5628b commit 320b4f0

File tree

3 files changed

+54
-50
lines changed

3 files changed

+54
-50
lines changed

package-lock.json

Lines changed: 48 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"types": "dist/index.d.ts",
2020
"dependencies": {
21-
"@codingame/monaco-languageclient-wrapper": "^2.6.0",
21+
"@codingame/monaco-languageclient-wrapper": "^2.8.0",
2222
"activity-detector": "^3.0.0",
2323
"react": ">=16.0.0"
2424
},

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, LanguageClientOptions } from '@codingame/monaco-languageclient-wrapper'
2+
import { createLanguageClientManager, LanguageClientId, StatusChangeEvent as WrapperStatusChangeEvent, LanguageClientManager, WillShutdownParams, Infrastructure, LanguageClientOptions, LanguageClientManagerOptions } from '@codingame/monaco-languageclient-wrapper'
33
import useIsUserActive from './hooks/useIsUserActive'
44
import useShouldShutdownLanguageClient from './hooks/useShouldShutdownLanguageClient'
55
import { 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

Comments
 (0)