Skip to content

Commit

Permalink
Hide server-side source control menus for client-side workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano committed Aug 20, 2024
1 parent 73c926d commit 42c4aea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,15 @@
},
{
"command": "vscode-objectscript.serverCommands.sourceControl",
"when": "(vscode-objectscript.connectActive && resourceScheme == isfs) || (vscode-objectscript.connectActive && !editorIsOpen)"
"when": "(vscode-objectscript.connectActive && resourceScheme == isfs) || (vscode-objectscript.connectActive && !editorIsOpen && virtualWorkspace)"
},
{
"command": "vscode-objectscript.serverCommands.contextSourceControl",
"when": "false"
},
{
"command": "vscode-objectscript.serverCommands.other",
"when": "vscode-objectscript.connectActive && resourceScheme =~ /^isfs(-readonly)?$/ || (vscode-objectscript.connectActive && !editorIsOpen)"
"when": "vscode-objectscript.connectActive && resourceScheme =~ /^isfs(-readonly)?$/ || (vscode-objectscript.connectActive && !editorIsOpen && virtualWorkspace)"
},
{
"command": "vscode-objectscript.serverCommands.contextOther",
Expand Down
6 changes: 3 additions & 3 deletions src/commands/serverActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export async function serverActions(): Promise<void> {
const { links } = config("conn");
const nsEncoded = encodeURIComponent(ns);
const actions: ServerAction[] = [];
const wsUri = uriOfWorkspaceFolder();
if (!api.externalServer) {
actions.push({
detail: (active ? "Disable" : "Enable") + " current connection",
Expand All @@ -47,7 +48,6 @@ export async function serverActions(): Promise<void> {
});

// Switching namespace makes only sense for non-ISFS folders
const wsUri = uriOfWorkspaceFolder();
if (wsUri && notIsfs(wsUri)) {
actions.push({
id: "switchNamespace",
Expand Down Expand Up @@ -137,7 +137,7 @@ export async function serverActions(): Promise<void> {
const classRef = `/csp/documatic/%25CSP.Documatic.cls?LIBRARY=${nsEncoded}${
classname ? "&CLASSNAME=" + classnameEncoded : ""
}`;
const project = new URLSearchParams(uriOfWorkspaceFolder()?.query).get("project") || "";
const project = new URLSearchParams(wsUri?.query).get("project") || "";
let extraLinks = 0;
for (const title in links) {
const rawLink = String(links[title]);
Expand Down Expand Up @@ -193,7 +193,7 @@ export async function serverActions(): Promise<void> {
detail: "Select a Studio Add-in to open",
});
if (
!vscode.window.activeTextEditor ||
(!vscode.window.activeTextEditor && wsUri && notIsfs(wsUri)) ||
vscode.window.activeTextEditor.document.uri.scheme === FILESYSTEM_SCHEMA ||
vscode.window.activeTextEditor.document.uri.scheme === FILESYSTEM_READONLY_SCHEMA
) {
Expand Down

0 comments on commit 42c4aea

Please sign in to comment.