@@ -117,8 +117,9 @@ export async function activate(context: vscode.ExtensionContext) {
117117 } ,
118118 ) ;
119119
120- const currVersionReleaseName =
121- "release_note_" + getPackageInfo ( context ) . extensionVersion ;
120+ const currVersionReleaseName = `release_note_${
121+ getPackageInfo ( context ) . extensionVersion
122+ } `;
122123 const viewedReleaseNote = context . globalState . get (
123124 currVersionReleaseName ,
124125 false ,
@@ -130,7 +131,7 @@ export async function activate(context: vscode.ExtensionContext) {
130131 }
131132
132133 const openWebview = ( ) => {
133- if ( currentPanel && currentPanel . webview ) {
134+ if ( currentPanel ? .webview ) {
134135 messagingService . setWebview ( currentPanel . webview ) ;
135136 currentPanel . webview . html = webviewService . getWebviewContent (
136137 WEBVIEW_TYPES . SIMULATOR ,
@@ -191,7 +192,7 @@ export async function activate(context: vscode.ExtensionContext) {
191192 state : message . text ,
192193 } ) ;
193194 switch ( message . command ) {
194- case WEBVIEW_MESSAGES . BUTTON_PRESS :
195+ case WEBVIEW_MESSAGES . BUTTON_PRESS : {
195196 // Send input to the Python process
196197 telemetryHandlerService . handleButtonPressTelemetry (
197198 message . text ,
@@ -206,11 +207,12 @@ export async function activate(context: vscode.ExtensionContext) {
206207 . emitInputChanged ( messageJson ) ;
207208 } else if ( childProcess ) {
208209 childProcess . stdin . write (
209- messageJson + "\n" ,
210+ ` ${ messageJson } \n` ,
210211 ) ;
211212 }
212213 break ;
213- case WEBVIEW_MESSAGES . TOGGLE_PLAY_STOP :
214+ }
215+ case WEBVIEW_MESSAGES . TOGGLE_PLAY_STOP : {
214216 console . log ( `Play button ${ messageJson } \n` ) ;
215217 if ( message . text . state as boolean ) {
216218 fileSelectionService . setPathAndSendMessage (
@@ -227,13 +229,14 @@ export async function activate(context: vscode.ExtensionContext) {
227229
228230 if ( childProcess ) {
229231 childProcess . stdin . write (
230- messageJson + "\n" ,
232+ ` ${ messageJson } \n` ,
231233 ) ;
232234 }
233235
234236 break ;
237+ }
235238 case WEBVIEW_MESSAGES . GESTURE :
236- case WEBVIEW_MESSAGES . SENSOR_CHANGED :
239+ case WEBVIEW_MESSAGES . SENSOR_CHANGED : {
237240 telemetryHandlerService . handleGestureTelemetry (
238241 message . text ,
239242 ) ;
@@ -247,30 +250,35 @@ export async function activate(context: vscode.ExtensionContext) {
247250 . emitInputChanged ( messageJson ) ;
248251 } else if ( childProcess ) {
249252 childProcess . stdin . write (
250- messageJson + "\n" ,
253+ ` ${ messageJson } \n` ,
251254 ) ;
252255 }
253256 break ;
254- case WEBVIEW_MESSAGES . REFRESH_SIMULATOR :
257+ }
258+ case WEBVIEW_MESSAGES . REFRESH_SIMULATOR : {
255259 console . log ( "Refresh button" ) ;
256260 runSimulatorCommand ( ) ;
257261 break ;
258- case WEBVIEW_MESSAGES . SLIDER_TELEMETRY :
262+ }
263+ case WEBVIEW_MESSAGES . SLIDER_TELEMETRY : {
259264 telemetryHandlerService . handleSensorTelemetry (
260265 message . text ,
261266 ) ;
262267 break ;
263- case WEBVIEW_MESSAGES . SWITCH_DEVICE :
268+ }
269+ case WEBVIEW_MESSAGES . SWITCH_DEVICE : {
264270 deviceSelectionService . setCurrentActiveDevice (
265271 message . text . active_device ,
266272 ) ;
267273 killProcessIfRunning ( ) ;
268274 break ;
269- default :
275+ }
276+ default : {
270277 vscode . window . showInformationMessage (
271278 CONSTANTS . ERROR . UNEXPECTED_MESSAGE ,
272279 ) ;
273280 break ;
281+ }
274282 }
275283 } ,
276284 undefined ,
@@ -354,8 +362,9 @@ export async function activate(context: vscode.ExtensionContext) {
354362
355363 const openTemplateFile = ( template : string ) => {
356364 const fileName = template ;
357- const filePath =
358- __dirname + path . sep + "templates" + path . sep + fileName ;
365+ const filePath = `${ __dirname + path . sep } templates${
366+ path . sep
367+ } ${ fileName } `;
359368 const file = fs . readFileSync ( filePath , "utf8" ) ;
360369 const showNewFilePopup : boolean = vscode . workspace
361370 . getConfiguration ( )
@@ -613,7 +622,7 @@ export async function activate(context: vscode.ExtensionContext) {
613622 messageToWebview = JSON . parse ( message ) ;
614623 // Check the JSON is a state
615624 switch ( messageToWebview . type ) {
616- case "state" :
625+ case "state" : {
617626 const messageData = JSON . parse (
618627 messageToWebview . data ,
619628 ) ;
@@ -627,8 +636,9 @@ export async function activate(context: vscode.ExtensionContext) {
627636 ) ;
628637 }
629638 break ;
639+ }
630640
631- case "print" :
641+ case "print" : {
632642 console . log (
633643 `Process print statement output = ${ messageToWebview . data } ` ,
634644 ) ;
@@ -637,12 +647,14 @@ export async function activate(context: vscode.ExtensionContext) {
637647 `[PRINT] ${ messageToWebview . data } ` ,
638648 ) ;
639649 break ;
650+ }
640651
641- default :
652+ default : {
642653 console . log (
643654 `Non-state JSON output from the process : ${ messageToWebview } ` ,
644655 ) ;
645656 break ;
657+ }
646658 }
647659 } catch ( err ) {
648660 if ( err instanceof SyntaxError ) {
0 commit comments