Skip to content

Commit 5ba17a9

Browse files
committed
small tweaks
1 parent 0f40012 commit 5ba17a9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/commands/compile.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ export async function importXMLFiles(): Promise<any> {
750750
connectionUri = (
751751
await vscode.window.showWorkspaceFolderPick({
752752
ignoreFocusOut: true,
753-
placeHolder: "Pick the workspace folder to get server connection information from",
753+
placeHolder: "Pick a workspace folder. Server-side folders import from the local file system.",
754754
})
755755
)?.uri;
756756
}
@@ -773,9 +773,9 @@ export async function importXMLFiles(): Promise<any> {
773773
return;
774774
}
775775
let defaultUri = vscode.workspace.getWorkspaceFolder(connectionUri)?.uri ?? connectionUri;
776-
if (defaultUri.scheme != "file") {
777-
// Need a default URI with file scheme or the open dialog
778-
// will show the virtual files from the workspace folder
776+
if (defaultUri.scheme == FILESYSTEM_SCHEMA) {
777+
// Need a default URI without the isfs scheme or the open dialog
778+
// will show the server-side files instead of local ones
779779
defaultUri = vscode.workspace.workspaceFile;
780780
if (defaultUri.scheme != "file") {
781781
vscode.window.showErrorMessage(

src/commands/export.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export async function exportDocumentsToXMLFile(): Promise<void> {
312312
connectionUri = (
313313
await vscode.window.showWorkspaceFolderPick({
314314
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.",
316316
})
317317
)?.uri;
318318
}
@@ -335,8 +335,8 @@ export async function exportDocumentsToXMLFile(): Promise<void> {
335335
return;
336336
}
337337
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
340340
// will show the virtual files from the workspace folder
341341
defaultUri = vscode.workspace.workspaceFile;
342342
if (defaultUri.scheme != "file") {
@@ -349,6 +349,10 @@ export async function exportDocumentsToXMLFile(): Promise<void> {
349349
// Remove the file name from the URI
350350
defaultUri = defaultUri.with({ path: defaultUri.path.split("/").slice(0, -1).join("/") });
351351
}
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+
}
352356
// Prompt the user for the documents to export
353357
const documents = await pickDocuments(api, "to export");
354358
if (documents.length == 0) {

0 commit comments

Comments
 (0)