File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,16 @@ export function activate(context: vscode.ExtensionContext) {
3737 const demoPath = path . join ( context . extensionPath , 'python_demos' ) ;
3838 if ( fs . existsSync ( demoPath ) ) {
3939 const uri = vscode . Uri . file ( demoPath ) ;
40- await vscode . commands . executeCommand ( 'vscode.openFolder' , uri , { forceNewWindow : true } ) ;
40+ const success = vscode . workspace . updateWorkspaceFolders (
41+ vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders . length : 0 ,
42+ 0 ,
43+ { uri : uri , name : 'Python Demos' }
44+ ) ;
45+ if ( success ) {
46+ vscode . window . showInformationMessage ( 'Python demo folder added to workspace.' ) ;
47+ } else {
48+ vscode . window . showErrorMessage ( 'Failed to add Python demo folder to workspace.' ) ;
49+ }
4150 } else {
4251 vscode . window . showErrorMessage ( 'Python demo files not found. Please reinstall the extension.' ) ;
4352 }
You can’t perform that action at this time.
0 commit comments