Skip to content

Commit 717d2b4

Browse files
committed
Install the support classes at the start of every run
1 parent 056dc48 commit 717d2b4

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.3 (dd-Mmm-yyyy)
2+
* Imporove positioning of assertion failure markers (#50)
3+
* Remove need to define helper SQL functions via DDL.
4+
15
## 2.0.2 (30-Jul-2025)
26
* Fix coverage marking when `"objectscript.multilineMethodArgs": true` (#46)
37
* Improve method range highlighting accessed from coverage tree (#48)

serverSide/src/vscode/dc/testingmanager/BaseManager.cls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Class vscode.dc.testingmanager.BaseManager [ Abstract ]
33
{
44

5+
Parameter VERSION As STRING = "2.0.3";
6+
57
Property tmMethodMap As %String [ MultiDimensional, Private ];
68

79
Method tmMapOneFile(file As %String) [ Private ]

serverSide/src/vscode/dc/testingmanager/CoverageManager.cls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ ClassMethod RunTest(ByRef testspec As %String, qspec As %String, ByRef userparam
77
Return ##super(testspec, qspec, .userparam)
88
}
99

10+
/// SQL function to convert an IRIS bitstring to an Int8 bitstring for ease of handling in Typescript
11+
/// Example usage: SELECT vscode_dc_testingmanager_CoverageManager.tmInt8Bitstring(cu.ExecutableLines) i8bsExecutableLines
1012
ClassMethod tmInt8Bitstring(bitstring As %String) As %String [ SqlProc ]
1113
{
1214
Set output = "", iMod8=-1, char=0, weight=1

src/commonRunTestsHandler.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,25 @@ export async function commonRunTestsHandler(controller: vscode.TestController, r
169169
// When client-side mode is using 'objectscript.conn.docker-compose the first piece of 'authority' is blank,
170170
if (authority.startsWith(":")) {
171171
authority = folder?.name || "";
172+
} else {
173+
authority = authority.split(":")[0];
172174
}
175+
176+
// Load our support classes
177+
// TODO - as an optimization, check if they already exist and with the correct #VERSION parameter
178+
try {
179+
const extensionUri = vscode.extensions.getExtension(extensionId)?.extensionUri;
180+
if (extensionUri) {
181+
const sourceDir = extensionUri.with({ path: extensionUri.path + '/serverSide/src' + '/vscode/dc/testingmanager'});
182+
const destinationDir = vscode.Uri.from({ scheme: 'isfs', authority: `${authority}:${namespace}`, path: '/vscode/dc/testingmanager'})
183+
await vscode.workspace.fs.copy(sourceDir, destinationDir, { overwrite: true });
184+
}
185+
} catch (error) {
186+
console.log(error);
187+
}
188+
173189
// No longer rely on ISFS redirection of /.vscode because since ObjectScript v3.0 it no longer works for client-only workspaces.
174-
const testRoot = vscode.Uri.from({ scheme: 'isfs', authority: authority.split(":")[0], path: `/_vscode/${namespace}/UnitTestRoot/${username}`, query: "csp&ns=%SYS" });
190+
const testRoot = vscode.Uri.from({ scheme: 'isfs', authority, path: `/_vscode/${namespace}/UnitTestRoot/${username}`, query: "csp&ns=%SYS" });
175191
try {
176192
// Limitation of the Atelier API means this can only delete the files, not the folders
177193
// but zombie folders shouldn't cause problems.

0 commit comments

Comments
 (0)