@@ -85,7 +85,7 @@ export async function activate(context: vscode.ExtensionContext) {
8585 }
8686
8787 if ( ! SerialMonitor . getInstance ( ) . initialized ) {
88- SerialMonitor . getInstance ( ) . initialize ( ) ;
88+ SerialMonitor . getInstance ( ) . initialize ( context ) ;
8989 }
9090
9191 const arduinoPath = arduinoContextModule . default . arduinoApp . settings . arduinoPath ;
@@ -106,7 +106,7 @@ export async function activate(context: vscode.ExtensionContext) {
106106 const registerNonArduinoCommand = ( command : string , commandBody : ( ...args : any [ ] ) => any , getUserData ?: ( ) => any ) : number => {
107107 return context . subscriptions . push ( vscode . commands . registerCommand ( command , async ( ...args : any [ ] ) => {
108108 if ( ! SerialMonitor . getInstance ( ) . initialized ) {
109- SerialMonitor . getInstance ( ) . initialize ( ) ;
109+ SerialMonitor . getInstance ( ) . initialize ( context ) ;
110110 }
111111 await commandExecution ( command , commandBody , args , getUserData ) ;
112112 } ) ) ;
@@ -281,12 +281,12 @@ export async function activate(context: vscode.ExtensionContext) {
281281 // serial monitor commands
282282 const serialMonitor = SerialMonitor . getInstance ( ) ;
283283 context . subscriptions . push ( serialMonitor ) ;
284- registerNonArduinoCommand ( "arduino.selectSerialPort" , ( ) => serialMonitor . selectSerialPort ( null , null ) ) ;
284+ registerNonArduinoCommand ( "arduino.selectSerialPort" , ( ) => serialMonitor . selectSerialPort ( ) ) ;
285285 registerNonArduinoCommand ( "arduino.openSerialMonitor" , ( ) => serialMonitor . openSerialMonitor ( ) ) ;
286- registerNonArduinoCommand ( "arduino.changeBaudRate" , ( ) => serialMonitor . changeBaudRate ( ) ) ;
287- registerNonArduinoCommand ( "arduino.changeTimestampFormat" , ( ) => serialMonitor . changeTimestampFormat ( ) ) ;
288- registerNonArduinoCommand ( "arduino.sendMessageToSerialPort" , ( ) => serialMonitor . sendMessageToSerialPort ( ) ) ;
289- registerNonArduinoCommand ( "arduino.closeSerialMonitor" , ( port , showWarning = true ) => serialMonitor . closeSerialMonitor ( port , showWarning ) ) ;
286+ // registerNonArduinoCommand("arduino.changeBaudRate", () => serialMonitor.changeBaudRate());
287+ // registerNonArduinoCommand("arduino.changeTimestampFormat", () => serialMonitor.changeTimestampFormat());
288+ // registerNonArduinoCommand("arduino.sendMessageToSerialPort", () => serialMonitor.sendMessageToSerialPort());
289+ registerNonArduinoCommand ( "arduino.closeSerialMonitor" , ( port ) => serialMonitor . closeSerialMonitor ( port ) ) ;
290290
291291 const completionProvider = new completionProviderModule . CompletionProvider ( ) ;
292292 context . subscriptions . push ( vscode . languages . registerCompletionItemProvider ( ARDUINO_MODE , completionProvider , "<" , '"' , "." ) ) ;
@@ -302,7 +302,7 @@ export async function activate(context: vscode.ExtensionContext) {
302302 }
303303
304304 if ( ! SerialMonitor . getInstance ( ) . initialized ) {
305- SerialMonitor . getInstance ( ) . initialize ( ) ;
305+ SerialMonitor . getInstance ( ) . initialize ( context ) ;
306306 }
307307 vscode . commands . executeCommand ( "setContext" , "vscode-arduino:showExampleExplorer" , true ) ;
308308 } ) ( ) ;
@@ -317,7 +317,7 @@ export async function activate(context: vscode.ExtensionContext) {
317317 await arduinoActivatorModule . default . activate ( ) ;
318318 }
319319 if ( ! SerialMonitor . getInstance ( ) . initialized ) {
320- SerialMonitor . getInstance ( ) . initialize ( ) ;
320+ SerialMonitor . getInstance ( ) . initialize ( context ) ;
321321 }
322322 vscode . commands . executeCommand ( "setContext" , "vscode-arduino:showExampleExplorer" , true ) ;
323323 }
@@ -411,14 +411,14 @@ export async function activate(context: vscode.ExtensionContext) {
411411
412412 setTimeout ( ( ) => {
413413 // delay to detect usb
414- usbDetectorModule . UsbDetector . getInstance ( ) . initialize ( context . extensionPath ) ;
414+ usbDetectorModule . UsbDetector . getInstance ( ) . initialize ( context ) ;
415415 usbDetectorModule . UsbDetector . getInstance ( ) . startListening ( ) ;
416416 } , 200 ) ;
417417}
418418
419419export async function deactivate ( ) {
420420 const monitor = SerialMonitor . getInstance ( ) ;
421- await monitor . closeSerialMonitor ( null , false ) ;
421+ await monitor . closeSerialMonitor ( null ) ;
422422 usbDetectorModule . UsbDetector . getInstance ( ) . stopListening ( ) ;
423423 Logger . traceUserData ( "deactivate-extension" ) ;
424424}
0 commit comments