Skip to content

Commit

Permalink
Merge pull request #1 from laughedelic/busy-signal
Browse files Browse the repository at this point in the history
Connect busy-signal
  • Loading branch information
laughedelic authored Feb 2, 2018
2 parents 3d7f845 + 1fbc622 commit cfd6c06
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
35 changes: 34 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class ScalaLanguageClient extends AutoLanguageClient {
const serverProcess = this.spawnChildNode([serverPath], {
cwd: projectPath
});
this.captureServerErrors(serverProcess);
return serverProcess;
}

Expand All @@ -45,6 +44,40 @@ class ScalaLanguageClient extends AutoLanguageClient {
}

filterChangeWatchedFiles(filePath) { return false; }

preInitialization(connection) {
connection.onLogMessage(params => {
if (params.type === 4 && params.message === 'Done') {
this.updateBusyMessage();
} else {
const init = (params.type === 4 && params.message === 'Processing');
this.updateBusyMessage(params.message, init);
}
});
}

busyMessageFormat(text) {
return `${this.getServerName()}: ${text}`;
}

updateBusyMessage(text = '', init = false, reveal = false) {
if (this.busyMessage != null) {
if (text === '') {
this.busyMessage.dispose();
this.busyMessage = null;
} else {
this.busyMessage.setTitle(
this.busyMessageFormat(text),
{ revealTooltip: reveal }
);
}
} else if (init) {
this.busyMessage = this.busySignalService.reportBusy(
this.busyMessageFormat(text),
{ revealTooltip: reveal }
);
}
}
}

module.exports = new ScalaLanguageClient()
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
"atom-languageclient": "0.8.2",
"atom-package-deps": "4.6.1"
},
"package-deps" : [ "language-scala", "atom-ide-ui" ],
"package-deps": [ "language-scala", "atom-ide-ui" ],
"consumedServices": {
"linter-indie": {
"versions": {
"2.0.0": "consumeLinterV2"
}
},
"atom-ide-busy-signal" : {
"versions" : {
"0.1.0" : "consumeBusySignal"
"atom-ide-busy-signal": {
"versions": {
"0.1.0": "consumeBusySignal"
}
}
},
Expand Down

0 comments on commit cfd6c06

Please # to comment.