Skip to content

Commit 450b1a3

Browse files
committed
feat: Add inactivityShutdown status
1 parent 3abace8 commit 450b1a3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/LanguageClient.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { ReactElement, useEffect, useRef, useState } from 'react'
2-
import { createLanguageClientManager, LanguageClientId, StatusChangeEvent, LanguageClientManager, WillShutdownParams } from '@codingame/monaco-languageclient-wrapper'
2+
import { createLanguageClientManager, LanguageClientId, StatusChangeEvent as WrapperStatusChangeEvent, LanguageClientManager, WillShutdownParams } from '@codingame/monaco-languageclient-wrapper'
33
import useIsUserActive from './hooks/useIsUserActive'
44
import useShouldShutdownLanguageClient from './hooks/useShouldShutdownLanguageClient'
55
import { useLastVersion } from './hooks/useLastVersion'
66

7+
export interface StatusChangeEvent {
8+
status: WrapperStatusChangeEvent['status'] | 'inactivityShutdown'
9+
}
10+
711
export interface LanguageClientProps {
812
id: LanguageClientId
913
sessionId?: string
@@ -64,6 +68,9 @@ function LanguageClient ({
6468
setWillShutdown(false)
6569

6670
if (shouldShutdownLanguageClient) {
71+
onDidChangeStatus({
72+
status: 'inactivityShutdown'
73+
})
6774
return
6875
}
6976

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LanguageClientId, loadExtensionConfigurations, registerLanguageClient } from '@codingame/monaco-languageclient-wrapper'
1+
import { LanguageClientId, loadExtensionConfigurations, registerLanguageClient, StatusChangeEvent } from '@codingame/monaco-languageclient-wrapper'
22
import LanguageClient, { LanguageClientProps } from './LanguageClient'
33

44
export default LanguageClient
@@ -8,5 +8,6 @@ export {
88
}
99
export type {
1010
LanguageClientProps,
11-
LanguageClientId
11+
LanguageClientId,
12+
StatusChangeEvent
1213
}

0 commit comments

Comments
 (0)