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

Commit dd4fdab

Browse files
authored
Fix serial monitor and extension dependency. (#174)
1 parent 0939476 commit dd4fdab

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@
131131
"info",
132132
"verbose"
133133
]
134-
},
135-
"arduino.clangFormatStyle": {
136-
"type": "string",
137-
"desription": "The clang-format style value. Set this value to file if want to use the .clang-format file"
138134
}
139135
}
140136
},
@@ -172,6 +168,9 @@
172168
"postinstall": "node ./node_modules/vscode/bin/install && cd ./html && npm install",
173169
"test": "node ./node_modules/vscode/bin/test"
174170
},
171+
"extensionDependencies": [
172+
"ms-vscode.cpptools"
173+
],
175174
"devDependencies": {
176175
"@types/mocha": "^2.2.32",
177176
"@types/node": "^6.0.40",

src/extension.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ export async function activate(context: vscode.ExtensionContext) {
4242
context.subscriptions.push(vscode.workspace.registerTextDocumentContentProvider(ARDUINO_MANAGER_PROTOCOL, arduinoManagerProvider));
4343

4444
let registerCommand = (command: string, commandBody: (...args: any[]) => any, getUserData?: () => any): vscode.Disposable => {
45-
return vscode.commands.registerCommand(command, async () => {
45+
return vscode.commands.registerCommand(command, async (...args: any[]) => {
4646
let guid = Uuid.create().value;
4747
Logger.traceUserData(`start-command-` + command, { correlationId: guid });
4848
let timer1 = new Logger.Timer();
4949
let telemetryResult;
5050
try {
51-
let result = commandBody();
51+
let result = commandBody(...args);
5252
if (result) {
5353
result = await Promise.resolve(result);
5454
}

src/serialmonitor/serialMonitor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class SerialMonitor {
132132
}
133133
await this._serialPortCtrl.stop();
134134
this.updatePortStatus(false);
135-
} else {
135+
} else if (!port) {
136136
Logger.notifyUserWarning("closeSerialMonitorError", new Error(constants.messages.SERIAL_PORT_NOT_STARTED));
137137
}
138138
}

0 commit comments

Comments
 (0)