Skip to content

Commit 05cc476

Browse files
committed
fix: Allow to send textDocument/save request when the language client is only connected
1 parent 4801314 commit 05cc476

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/infrastructure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export abstract class CodinGameInfrastructure implements Infrastructure {
9595
}]
9696

9797
public async saveFileContent (document: TextDocument, reason: TextDocumentSaveReason, languageClient: LanguageClientManager): Promise<void> {
98-
if (languageClient.isReady()) {
98+
if (languageClient.isConnected()) {
9999
await updateFile(document.uri.toString(), document.getText(), languageClient)
100100
}
101101
}

src/languageClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export class LanguageClientManager implements LanguageClient {
5151
})
5252
}
5353

54-
isReady (): boolean {
55-
return this.currentStatus === 'ready'
54+
isConnected (): boolean {
55+
return ['connected', 'ready'].includes(this.currentStatus)
5656
}
5757

5858
async dispose (): Promise<void> {

0 commit comments

Comments
 (0)