Skip to content

Commit

Permalink
Merge pull request #10 from alexander-daniel/add-stop-sclang-command
Browse files Browse the repository at this point in the history
add a command to stop sclang
  • Loading branch information
alexander-daniel authored Apr 27, 2023
2 parents d2a85d9 + 4da7fde commit 167a15e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
21 changes: 21 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ async function activate(context) {

context.subscriptions.push(startSCLang);

const stopSCLang = vscode.commands.registerCommand('supercollider.stopSCLang', async () => {

if (!lang) {
postWindow.appendLine('sclang is not currently running.');
return;
}

try {
await lang.quit();
lang = null;
statusBar.text = 'sclang 🔴';
statusBar.show();
}
catch (err) {
postWindow.appendLine(err);
console.log(err);
}
});

context.subscriptions.push(stopSCLang);

const bootSCServer = vscode.commands.registerCommand('supercollider.bootServer', async () => {
if (!lang) {
postWindow.appendLine('sclang not started, cannot boot scsynth using s.boot.');
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
"title": "Start sclang",
"category": "SuperCollider"
},
{
"command": "supercollider.stopSCLang",
"title": "Stop sclang",
"category": "SuperCollider"
},
{
"command": "supercollider.bootServer",
"title": "Boot a SuperCollider Server (scsynth)",
Expand Down Expand Up @@ -97,4 +102,4 @@
"extensionDependencies": [
"draivin.hscopes"
]
}
}

0 comments on commit 167a15e

Please sign in to comment.