Skip to content

Commit 794862d

Browse files
authored
Add mapped options for isfs and export (intersystems-community#932)
1 parent 9869c62 commit 794862d

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

docs/ServerSide.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,15 @@ Changes you make to files opened from this root folder of your VS Code workspace
147147

148148
The query string of the `uri` property accepts several parameters that control filtering and display of the server-side entities. The examples below access the USER namespace on the server whose definition is named 'myserver'.
149149

150-
- `isfs://myserver:user?type=cls`, shows only classes
151-
- `isfs://myserver:user?type=rtn`, shows only mac, int and inc files
152-
- `isfs://myserver:user?generated=1`, shows generated files as well as not generated
153-
- `isfs://myserver:user?filter=%Z*.mac,%z*.mac`, comma-delimited list of search options, ignores `type`. The default is `*.cls,*.inc,*.mac,*.int`. To see all files, use `*`.
154-
- `isfs://myserver:user?flat=1`, a flat list of files. Does not split packages as folders. Cannot be combined with `csp`.
155-
- `isfs://myserver:user?project=prjname`, shows only files in project `prjname`. Cannot be combined with any other parameter.
156-
157-
The options `flat` and `generated` can be combined with each other, and with `type` or `filter`. If `filter` is specified, `type` is ignored.
150+
- `isfs://myserver:user/?type=cls`, shows only classes
151+
- `isfs://myserver:user/?type=rtn`, shows only mac, int and inc files
152+
- `isfs://myserver:user/?generated=1`, shows generated files as well as not generated
153+
- `isfs://myserver:user/?filter=%Z*.mac,%z*.mac`, comma-delimited list of search options, ignores `type`. The default is `*.cls,*.inc,*.mac,*.int`. To see all files, use `*`.
154+
- `isfs://myserver:user/?flat=1`, a flat list of files. Does not split packages as folders. Cannot be combined with `csp`.
155+
- `isfs://myserver:user/?project=prjname`, shows only files in project `prjname`. Cannot be combined with any other parameter.
156+
- `isfs://myserver:user/?mapped=0`, hides files that are mapped from a non-default database
157+
158+
The options `flat`, `generated` and `mapped` can be combined with each other, and with `type` or `filter`. If `filter` is specified, `type` is ignored.
158159

159160
## Advanced Workspace Configurations
160161

docs/SettingsReference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ The extensions in the InterSystems ObjectScript Extension Pack provide many sett
5151
| `"objectscript.export.folder"` | Folder for exported source code within workspace. | `string` | `"src"` | |
5252
| `"objectscript.export.generated"` | Export generated source code files, such as INTs generated from classes. | `boolean` | `false` | |
5353
| `"objectscript.export.map"` | Map file names before export, with regexp pattern as a key and replacement as a value. | `object` | `{}` | For example, `{ \"%(.*)\": \"_$1\" }` to make % classes or routines use underscore prefix instead. |
54+
| `"objectscript.export.mapped"` | Export source code files mapped from a non-default database. | `boolean` | `true` | |
5455
| `"objectscript.export.maxConcurrentConnections"` | Maximum number of concurrent export connections. | `number` | `0` | 0 = unlimited |
5556
| `"objectscript.export.noStorage"` | Strip the storage definition on export. | `boolean` | `false` | Can be useful when working across multiple systems. |
5657
| `"objectscript.format.commandCase"` | Case for commands. | `"upper"`, `"lower"` or `"word"` | `"word"` | Has no effect if the `InterSystems Language Server` extension is installed and enabled. |

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,8 @@
10711071
"category": "*",
10721072
"noStorage": false,
10731073
"dontExportIfNoChanges": false,
1074-
"maxConcurrentConnections": 0
1074+
"maxConcurrentConnections": 0,
1075+
"mapped": true
10751076
},
10761077
"properties": {
10771078
"folder": {
@@ -1149,6 +1150,10 @@
11491150
"maxConcurrentConnections": {
11501151
"description": "Maximum number of concurrent export connections. (0 = unlimited)",
11511152
"type": "number"
1153+
},
1154+
"mapped": {
1155+
"description": "Export source code files mapped from a non-default database.",
1156+
"type": "boolean"
11521157
}
11531158
}
11541159
},

src/commands/export.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export async function exportAll(): Promise<any> {
246246
}
247247
const api = new AtelierAPI(workspaceFolder);
248248
outputChannel.show(true);
249-
const { category, generated, filter, exactFilter } = config("export", workspaceFolder);
249+
const { category, generated, filter, exactFilter, mapped } = config("export", workspaceFolder);
250250
// Replicate the behavior of getDocNames() but use StudioOpenDialog for better performance
251251
let filterStr = "";
252252
switch (category) {
@@ -277,7 +277,7 @@ export async function exportAll(): Promise<any> {
277277
}
278278
}
279279
return api
280-
.actionQuery("SELECT Name FROM %Library.RoutineMgr_StudioOpenDialog(?,?,?,?,?,?,?,?)", [
280+
.actionQuery("SELECT Name FROM %Library.RoutineMgr_StudioOpenDialog(?,?,?,?,?,?,?,?,?,?)", [
281281
"*",
282282
"1",
283283
"1",
@@ -286,6 +286,8 @@ export async function exportAll(): Promise<any> {
286286
"0",
287287
generated ? "1" : "0",
288288
filterStr,
289+
"0",
290+
mapped ? "1" : "0",
289291
])
290292
.then(async (data) => {
291293
let files: vscode.QuickPickItem[] = data.result.content.map((file) => {

src/utils/FileProviderUtil.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function studioOpenDialogFromURI(
136136
if (!api.active) {
137137
return;
138138
}
139-
const sql = `SELECT Name, Type FROM %Library.RoutineMgr_StudioOpenDialog(?,?,?,?,?,?,?,?)`;
139+
const sql = `SELECT Name, Type FROM %Library.RoutineMgr_StudioOpenDialog(?,?,?,?,?,?,?,?,?,?)`;
140140
const params = new URLSearchParams(uri.query);
141141
const csp = params.has("csp") && ["", "1"].includes(params.get("csp"));
142142
const spec = fileSpecFromURI(uri, overrides.type);
@@ -150,5 +150,6 @@ export function studioOpenDialogFromURI(
150150
if (overrides && overrides.flat) {
151151
flat = "1";
152152
}
153-
return api.actionQuery(sql, [spec, dir, orderBy, system, flat, notStudio, generated, overrides.filter]);
153+
const mapped = params.has("mapped") && params.get("mapped") == "0" ? "0" : "1";
154+
return api.actionQuery(sql, [spec, dir, orderBy, system, flat, notStudio, generated, overrides.filter, "0", mapped]);
154155
}

0 commit comments

Comments
 (0)