Skip to content

Commit

Permalink
fix: initialization loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Vtec234 committed Jun 29, 2021
1 parent d37c9a6 commit 4c1cdbc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions vscode-lean4/src/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class Rpc {
}, 50)
this.resolveInit = () => {
clearInterval(interval as any)
sendMessage({kind: 'initialize'})
resolve()
}
})
Expand All @@ -25,8 +24,12 @@ export class Rpc {

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
messageReceived(msg: any): void {
if (msg.kind && msg.kind === 'initialize' && this.resolveInit) {
this.resolveInit()
if (msg.kind) {
if (msg.kind === 'initialize') {
this.sendMessage({kind: 'initialized'})
} else if (msg.kind === 'initialized' && this.resolveInit) {
this.resolveInit()
}
return
}
const {seqNum, name, args, result, exception} = msg
Expand Down

0 comments on commit 4c1cdbc

Please sign in to comment.