Skip to content

Commit 0aec42b

Browse files
authored
Show server-side source control menus when clicking on a project workspace folder root (#1548)
1 parent fe9be08 commit 0aec42b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,12 @@
571571
},
572572
{
573573
"command": "vscode-objectscript.serverCommands.contextSourceControl",
574-
"when": "resourceScheme == isfs && vscode-objectscript.connectActive && resourcePath && !(resourcePath =~ /^\\/?$/) && !(explorerResourceIsFolder && resource =~ /\\?csp(%3D1|$)/) && !listMultiSelection",
574+
"when": "resourceScheme == isfs && vscode-objectscript.connectActive && ((resourcePath && !(resourcePath =~ /^\\/?$/)) || resource =~ /project%3D/) && !(explorerResourceIsFolder && resource =~ /\\?csp(%3D1|$)/) && !listMultiSelection",
575575
"group": "objectscript_servercommand@1"
576576
},
577577
{
578578
"command": "vscode-objectscript.serverCommands.contextOther",
579-
"when": "resourceScheme =~ /^isfs(-readonly)?$/ && vscode-objectscript.connectActive && resourcePath && !(resourcePath =~ /^\\/?$/) && !(explorerResourceIsFolder && resource =~ /\\?csp(%3D1|$)/) && !listMultiSelection",
579+
"when": "resourceScheme =~ /^isfs(-readonly)?$/ && vscode-objectscript.connectActive && ((resourcePath && !(resourcePath =~ /^\\/?$/)) || resource =~ /project%3D/) && !(explorerResourceIsFolder && resource =~ /\\?csp(%3D1|$)/) && !listMultiSelection",
580580
"group": "objectscript_servercommand@2"
581581
},
582582
{

src/providers/FileSystemProvider/FileSystemProvider.ts

+6
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ export function isCSP(uri: vscode.Uri): boolean {
204204

205205
/** Get the document name of the file in `uri`. */
206206
export function isfsDocumentName(uri: vscode.Uri, csp?: boolean, pkg = false): string {
207+
const { project } = isfsConfig(uri);
208+
if (pkg && project && ["", "/"].includes(uri.path)) {
209+
// pkg is only true when opening a context server-side source control menu.
210+
// When called on a project workspace root folder, show the menu for the project.
211+
return `${project}.PRJ`;
212+
}
207213
if (csp == undefined) csp = isCSP(uri);
208214
const doc = csp ? uri.path : uri.path.slice(1).replace(/\//g, ".");
209215
// Add the .PKG extension to non-web folders if called from StudioActions

0 commit comments

Comments
 (0)