@@ -25,6 +25,7 @@ import {
2525 handleError ,
2626 isClassDeployed ,
2727 isClassOrRtn ,
28+ lastUsedLocalUri ,
2829 notIsfs ,
2930 notNull ,
3031 outputChannel ,
@@ -649,7 +650,7 @@ export async function importLocalFilesToServerSideFolder(wsFolderUri: vscode.Uri
649650 }
650651 const api = new AtelierAPI ( wsFolderUri ) ;
651652 // Get the default URI and remove the file anme
652- let defaultUri = vscode . workspace . workspaceFile ;
653+ let defaultUri = lastUsedLocalUri ( ) ?? vscode . workspace . workspaceFile ;
653654 defaultUri = defaultUri . with ( { path : defaultUri . path . split ( "/" ) . slice ( 0 , - 1 ) . join ( "/" ) } ) ;
654655 // Prompt the user for files to import
655656 let uris = await vscode . window . showOpenDialog ( {
@@ -674,6 +675,7 @@ export async function importLocalFilesToServerSideFolder(wsFolderUri: vscode.Uri
674675 vscode . window . showErrorMessage ( "No classes or routines were selected." , "Dismiss" ) ;
675676 return ;
676677 }
678+ lastUsedLocalUri ( uris [ 0 ] ) ;
677679 // Get the name and content of the files to import
678680 const textDecoder = new TextDecoder ( ) ;
679681 const docs = await Promise . allSettled < { name : string ; content : string ; uri : vscode . Uri } > (
@@ -777,7 +779,7 @@ export async function importXMLFiles(): Promise<any> {
777779 if ( defaultUri . scheme == FILESYSTEM_SCHEMA ) {
778780 // Need a default URI without the isfs scheme or the open dialog
779781 // will show the server-side files instead of local ones
780- defaultUri = vscode . workspace . workspaceFile ;
782+ defaultUri = lastUsedLocalUri ( ) ?? vscode . workspace . workspaceFile ;
781783 if ( defaultUri . scheme != "file" ) {
782784 vscode . window . showErrorMessage (
783785 "'Import XML Files...' command is not supported for unsaved workspaces." ,
@@ -809,6 +811,7 @@ export async function importXMLFiles(): Promise<any> {
809811 vscode . window . showErrorMessage ( "No XML files were selected." , "Dismiss" ) ;
810812 return ;
811813 }
814+ lastUsedLocalUri ( uris [ 0 ] ) ;
812815 // Read the XML files
813816 const fileTimestamps : Map < string , string > = new Map ( ) ;
814817 const filesToList = await Promise . allSettled (
0 commit comments