Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit fa72c86

Browse files
committed
Fix cannot set property of undefined when no busySignalService
1 parent 8599d99 commit fa72c86

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/rls-project.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ class RlsProject {
2323
// ie a `didChangeConfiguration` during a build, so we consider Rls
2424
// to be building as long as we're waiting for _any_ build.
2525
server.connection.onCustom('rustDocument/beginBuild', () => {
26-
if (!this._busyMessage) {
26+
if (this._busyMessage) {
27+
this._busyMessage.count += 1
28+
}
29+
else {
2730
let busySignal = this.getBusySignalService()
28-
this._busyMessage = busySignal &&
29-
busySignal.reportBusy(`RLS building ${path.basename(this.server.projectPath)}`)
30-
this._busyMessage.count = 0
31+
if (busySignal) {
32+
this._busyMessage = busySignal
33+
.reportBusy(`RLS building ${path.basename(this.server.projectPath)}`)
34+
this._busyMessage.count = 1
35+
}
3136
}
32-
33-
this._busyMessage.count += 1
3437
})
3538
server.connection.onCustom('rustDocument/diagnosticsEnd', () => {
3639
if (this._busyMessage && this._busyMessage.count > 0) {

0 commit comments

Comments
 (0)