Skip to content

Commit a438d13

Browse files
authored
Support a ${project} variable in Server Actions Menu custom entries (intersystems-community#1157)
1 parent fb94808 commit a438d13

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/Configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ You can add custom entries to this list using the `objectscript.conn.links` conf
241241
- **${namespace}** - The raw `ns` parameter of the connection. For example, `sys` or `user`
242242
- **${classname}** - The name of the currently opened class, or the empty string if the currently opened document is not a class.
243243
- **${classnameEncoded}** - URL encoded version of **\${classname}**.
244+
- **${project}** - The currently opened server-side project, or the empty string.
244245

245246
An example links configuration looks like this:
246247

src/commands/serverActions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export async function serverActions(): Promise<void> {
137137
classname ? "&CLASSNAME=" + classnameEncoded : ""
138138
}`;
139139
const soapWizardPath = "/isc/studio/templates/%25ZEN.Template.AddInWizard.SOAPWizard.cls";
140+
const project = new URLSearchParams(uriOfWorkspaceFolder()?.query).get("project") || "";
140141
let extraLinks = 0;
141142
let hasSOAPWizard = false;
142143
for (const title in links) {
@@ -156,7 +157,8 @@ export async function serverActions(): Promise<void> {
156157
.replace("${ns}", nsEncoded)
157158
.replace("${namespace}", ns == "%SYS" ? "sys" : nsEncoded.toLowerCase())
158159
.replace("${classname}", classname)
159-
.replace("${classnameEncoded}", classnameEncoded);
160+
.replace("${classnameEncoded}", classnameEncoded)
161+
.replace("${project}", project);
160162
actions.push({
161163
id: "extraLink" + extraLinks++,
162164
label: title,

0 commit comments

Comments
 (0)