Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Mar 21, 2024
1 parent 8713419 commit eafa81a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extension/src/server/language-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,22 @@ export class LanguageServerAPI {
})
}

this.#subscriptions.push(this.#config.fileModified$.subscribe(() => {
this.#subscriptions.push(this.#config.fileModified$.subscribe(function notify (this: LanguageServerAPI): void {
// Reload configuration
if (this.clientState$.getValue() === State.Running) {
tryReloadConfig()
} else if (this.clientState$.getValue() === State.Starting) {
// Wait for client to connect
void firstValueFrom(this.clientState$.pipe(filter((state) => state === State.Running))).then(() => {
tryReloadConfig()
notify.call(this)
})
} else {
// Start client
void this.startClient().then(() => {
tryReloadConfig()
})
}
}))
}.bind(this)))

this.#subscriptions.push(this.#config.pathChanged$.subscribe(() => {
// Restart client
Expand Down

0 comments on commit eafa81a

Please sign in to comment.