@@ -312,7 +312,7 @@ export async function exportDocumentsToXMLFile(): Promise<void> {
312
312
connectionUri = (
313
313
await vscode . window . showWorkspaceFolderPick ( {
314
314
ignoreFocusOut : true ,
315
- placeHolder : "Pick the workspace folder to get server connection information from " ,
315
+ placeHolder : "Pick a workspace folder. Server-side folders export to the local file system. " ,
316
316
} )
317
317
) ?. uri ;
318
318
}
@@ -335,8 +335,8 @@ export async function exportDocumentsToXMLFile(): Promise<void> {
335
335
return ;
336
336
}
337
337
let defaultUri = vscode . workspace . getWorkspaceFolder ( connectionUri ) ?. uri ?? connectionUri ;
338
- if ( defaultUri . scheme != "file" ) {
339
- // Need a default URI with file scheme or the save dialog
338
+ if ( schemas . includes ( defaultUri . scheme ) ) {
339
+ // Need a default URI without the isfs scheme or the save dialog
340
340
// will show the virtual files from the workspace folder
341
341
defaultUri = vscode . workspace . workspaceFile ;
342
342
if ( defaultUri . scheme != "file" ) {
@@ -349,6 +349,10 @@ export async function exportDocumentsToXMLFile(): Promise<void> {
349
349
// Remove the file name from the URI
350
350
defaultUri = defaultUri . with ( { path : defaultUri . path . split ( "/" ) . slice ( 0 , - 1 ) . join ( "/" ) } ) ;
351
351
}
352
+ if ( ! vscode . workspace . fs . isWritableFileSystem ( defaultUri . scheme ) ) {
353
+ vscode . window . showErrorMessage ( `Cannot export to read-only file system '${ defaultUri . scheme } '.` , "Dismiss" ) ;
354
+ return ;
355
+ }
352
356
// Prompt the user for the documents to export
353
357
const documents = await pickDocuments ( api , "to export" ) ;
354
358
if ( documents . length == 0 ) {
0 commit comments