Skip to content

Commit

Permalink
Permit Modify Server-side Workspace Folder... before connection bec…
Browse files Browse the repository at this point in the history
…omes active (#1477)

* Permit `Modify Server-side Workspace Folder...` before connection becomes active

* Improve the fix
  • Loading branch information
gjsjohnmurray authored Feb 5, 2025
1 parent 7384a0b commit c084a5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
},
{
"command": "vscode-objectscript.modifyWsFolder",
"when": "vscode-objectscript.connectActive && workspaceFolderCount != 0"
"when": "workspaceFolderCount != 0"
},
{
"command": "vscode-objectscript.openErrorLocation",
Expand Down Expand Up @@ -606,7 +606,7 @@
},
{
"command": "vscode-objectscript.modifyWsFolder",
"when": "vscode-objectscript.connectActive && resourceScheme =~ /^isfs(-readonly)?$/ && explorerResourceIsRoot && !listMultiSelection",
"when": "(!resourceScheme || resourceScheme =~ /^isfs(-readonly)?$/) && explorerResourceIsRoot && !listMultiSelection",
"group": "objectscript_modify@3"
},
{
Expand Down
14 changes: 7 additions & 7 deletions src/commands/addServerNamespaceToWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,20 +397,20 @@ export async function modifyWsFolder(wsFolderUri?: vscode.Uri): Promise<void> {
if (!wsFolder) {
return;
}
if (notIsfs(wsFolder.uri)) {
vscode.window.showErrorMessage(
`Workspace folder '${wsFolder.name}' does not have scheme 'isfs' or 'isfs-readonly'.`,
"Dismiss"
);
return;
}
} else {
// Find the workspace folder for this uri
wsFolder = vscode.workspace.getWorkspaceFolder(wsFolderUri);
if (!wsFolder) {
return;
}
}
if (notIsfs(wsFolder.uri)) {
vscode.window.showErrorMessage(
`Workspace folder '${wsFolder.name}' does not have scheme 'isfs' or 'isfs-readonly'.`,
"Dismiss"
);
return;
}

// Prompt the user to modify the uri
const newUri = await modifyWsFolderUri(wsFolder.uri);
Expand Down

0 comments on commit c084a5e

Please sign in to comment.