Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mactkg committed Nov 19, 2019
1 parent df41771 commit d764218
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 78 deletions.
100 changes: 50 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
{
"name": "sonic-pi",
"displayName": "sonic-pi",
"description": "Play Sonic Pi with VSCode!",
"version": "0.0.1",
"publisher": "mactkg",
"repository": {
"type": "git",
"url": "https://github.com/mactkg/vscode-sonic-pi.git"
},
"engines": {
"vscode": "^1.24.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:extension.runCode",
"onCommand:extension.stopAll"
],
"main": "./out/extension",
"contributes": {
"commands": [
{
"command": "extension.runCode",
"title": "Run Code on Sonic Pi"
},
{
"command": "extension.stopAll",
"title": "Stop All Sounds on Sonic Pi"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
"devDependencies": {
"typescript": "^2.6.1",
"vscode": "^1.1.6",
"tslint": "^5.8.0",
"@types/node": "^7.0.43",
"@types/mocha": "^2.2.42"
},
"dependencies": {
"iconv-lite": "^0.5.0",
"osc-js": "^1.2.2"
}
"name": "sonic-pi",
"displayName": "sonic-pi",
"description": "Play Sonic Pi with VSCode!",
"version": "0.0.1",
"publisher": "mactkg",
"repository": {
"type": "git",
"url": "https://github.com/mactkg/vscode-sonic-pi.git"
},
"engines": {
"vscode": "^1.24.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:extension.runCode",
"onCommand:extension.stopAll"
],
"main": "./out/extension",
"contributes": {
"commands": [
{
"command": "extension.runCode",
"title": "Run Code on Sonic Pi"
},
{
"command": "extension.stopAll",
"title": "Stop All Sounds on Sonic Pi"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
"devDependencies": {
"typescript": "^2.6.1",
"vscode": "^1.1.6",
"tslint": "^5.8.0",
"@types/node": "^7.0.43",
"@types/mocha": "^2.2.42"
},
"dependencies": {
"iconv-lite": "^0.5.0",
"osc-js": "^1.2.2"
}
}
12 changes: 6 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ class SonicPi {


constructor() {
this.osc = new OSC({
plugin: new OSC.DatagramPlugin({ send: { port: 4557 } })
this.osc = new OSC({
plugin: new OSC.DatagramPlugin({ send: { port: 4557 } })
});
this.osc.open({ port: 4558 });
}

public runCode() {
let code = this.getCurrentCode();
if(!code) {
if (!code) {
return;
}

Expand All @@ -47,18 +47,18 @@ class SonicPi {

public stopAllCode() {
const msg = new OSC.Message('/stop-all-jobs', this.GUI_ID);
this.osc.send(msg);
this.osc.send(msg);
}

public getCurrentCode(): Buffer | undefined {
let editor = window.activeTextEditor;
if(!editor) {
if (!editor) {
return;
}
return ICONV.encode(editor.document.getText(), "utf-8");
}

dispose() {
this.osc.close()
this.osc.close();
}
}
39 changes: 17 additions & 22 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"sourceMap": true,
"rootDir": "src",
/* Strict Type-Checking Option */
"strict": true, /* enable all strict type-checking options */
/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": [
"node_modules",
".vscode-test"
]
}
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": ["es6"],
"sourceMap": true,
"rootDir": "src",
/* Strict Type-Checking Option */
"strict": true /* enable all strict type-checking options */,
/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": ["node_modules", ".vscode-test"]
}

0 comments on commit d764218

Please sign in to comment.