File tree Expand file tree Collapse file tree 2 files changed +26
-14
lines changed Expand file tree Collapse file tree 2 files changed +26
-14
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,16 @@ export class NewMicroPythonProjectPanel {
7777 if ( ! settings ) {
7878 panel . dispose ( ) ;
7979
80- // TODO: maybe add restart button
81- void window . showErrorMessage (
82- "Failed to load settings. Please restart VSCode."
83- ) ;
80+ void window
81+ . showErrorMessage (
82+ "Failed to load settings. Please restart VS Code or reload the window." ,
83+ "Reload Window"
84+ )
85+ . then ( selected => {
86+ if ( selected === "Reload Window" ) {
87+ commands . executeCommand ( "workbench.action.reloadWindow" ) ;
88+ }
89+ } ) ;
8490
8591 return ;
8692 }
@@ -354,11 +360,9 @@ print("Finished.")\r\n`;
354360 await new Promise ( resolve => setTimeout ( resolve , 2000 ) ) ;
355361
356362 // open and call initialise
357- void commands . executeCommand (
358- "vscode.openFolder" ,
359- Uri . file ( projectFolder ) ,
360- ( workspace . workspaceFolders ?. length ?? 0 ) > 0
361- ) ;
363+ void commands . executeCommand ( "vscode.openFolder" , Uri . file ( projectFolder ) , {
364+ forceNewWindow : ( workspace . workspaceFolders ?. length ?? 0 ) > 0 ,
365+ } ) ;
362366 }
363367
364368 private async _update ( ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -384,10 +384,16 @@ export class NewProjectPanel {
384384 if ( settings === undefined ) {
385385 panel . dispose ( ) ;
386386
387- // TODO: maybe add restart button
388- void window . showErrorMessage (
389- "Failed to load settings. Please restart VSCode."
390- ) ;
387+ void window
388+ . showErrorMessage (
389+ "Failed to load settings. Please restart VS Code or reload the window." ,
390+ "Reload Window"
391+ )
392+ . then ( selected => {
393+ if ( selected === "Reload Window" ) {
394+ commands . executeCommand ( "workbench.action.reloadWindow" ) ;
395+ }
396+ } ) ;
391397
392398 return ;
393399 }
@@ -2230,7 +2236,9 @@ export class NewProjectPanel {
22302236 ? options . projectRoot
22312237 : join ( options . projectRoot , projectName )
22322238 ) ,
2233- ( workspace . workspaceFolders ?. length ?? 0 ) > 0
2239+ {
2240+ forceNewWindow : ( workspace . workspaceFolders ?. length ?? 0 ) > 0 ,
2241+ }
22342242 ) ;
22352243
22362244 // restart the extension if the folder was already open cause then vscode won't
You can’t perform that action at this time.
0 commit comments