Skip to content

Commit 70b322c

Browse files
committed
Merge remote-tracking branch 'upstream/master' into client-side-compile-update
2 parents 50d87fa + b5078fc commit 70b322c

File tree

7 files changed

+66
-46
lines changed

7 files changed

+66
-46
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change Log
22

3+
## [3.0.4] 30-Jun-2025
4+
- Enhancements
5+
- Shorten server-side error messages (#1587)
6+
- Make it more clear when a server connection failed due to a timeout (#1592)
7+
- Fixes
8+
- Fix mapping of breakpoints when debugging a local file on Windows (#1586)
9+
- Fix routine location status bar item flickering while typing (#1590)
10+
- Fix comparing of local and server versions of web app files (#1599)
11+
312
## [3.0.3] 16-Jun-2025
413
- Enhancements
514
- Cache the contents of files fetched during a debug session (#1579)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ To unlock these features (optional):
5555

5656
1. Download and install a beta version from GitHub. This is necessary because Marketplace does not allow publication of extensions that use proposed APIs.
5757
- Go to https://github.com/intersystems-community/vscode-objectscript/releases
58-
- Locate the beta immediately above the release you installed from Marketplace. For instance, if you installed `3.0.3`, look for `3.0.4-beta.1`. This will be functionally identical to the Marketplace version apart from being able to use proposed APIs.
59-
- Download the VSIX file (for example `vscode-objectscript-3.0.4-beta.1.vsix`) and install it. One way to install a VSIX is to drag it from your download folder and drop it onto the list of extensions in the Extensions view of VS Code.
58+
- Locate the beta immediately above the release you installed from Marketplace. For instance, if you installed `3.0.4`, look for `3.0.5-beta.1`. This will be functionally identical to the Marketplace version apart from being able to use proposed APIs.
59+
- Download the VSIX file (for example `vscode-objectscript-3.0.5-beta.1.vsix`) and install it. One way to install a VSIX is to drag it from your download folder and drop it onto the list of extensions in the Extensions view of VS Code.
6060

6161
2. From [Command Palette](https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_command-palette) choose `Preferences: Configure Runtime Arguments`.
6262
3. In the argv.json file that opens, add this line (required for both Stable and Insiders versions of VS Code):

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-objectscript",
33
"displayName": "InterSystems ObjectScript",
44
"description": "InterSystems ObjectScript language support for Visual Studio Code",
5-
"version": "3.0.4-SNAPSHOT",
5+
"version": "3.0.5-SNAPSHOT",
66
"icon": "images/logo.png",
77
"aiKey": "9cd75d51-697c-406c-a929-2bcf46e97c64",
88
"categories": [

src/commands/compile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ What do you want to do?`,
168168
vscode.Uri.file(file.name).with({
169169
scheme: OBJECTSCRIPT_FILE_SCHEMA,
170170
authority: file.workspaceFolder,
171+
query: file.name.includes("/") ? "csp" : "",
171172
}),
172173
file.uri,
173174
`Server • ${file.name} ↔ Local • ${file.fileName}`

src/debug/debugSession.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,11 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
361361
try {
362362
await this._waitForDebugTarget();
363363

364-
const uri = vscode.Uri.parse(args.source.path);
364+
// args.source.path is a file path if the file is local and is a stringified Uri if the file is virtual
365+
const uri =
366+
(this._workspaceFolderUri ?? vscode.workspace.workspaceFolders[0]?.uri)?.scheme == "file"
367+
? vscode.Uri.file(args.source.path)
368+
: vscode.Uri.parse(args.source.path);
365369
const wsFolder = vscode.workspace.getWorkspaceFolder(uri);
366370
if (!wsFolder || (this._workspaceFolderUri && wsFolder.uri.toString() != this._workspaceFolderUri.toString())) {
367371
response.body = {

src/extension.ts

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ async function resolvePassword(serverSpec, ignoreUnauthenticated = false): Promi
298298
});
299299
}
300300
if (session) {
301-
// If original spec lacked username use the one obtained by the authprovider
301+
// If original spec lacked username use the one obtained from the user by the authprovider (exact case)
302302
serverSpec.username = serverSpec.username || session.scopes[1];
303303
serverSpec.password = session.accessToken;
304304
}
@@ -562,6 +562,10 @@ export async function checkConnection(
562562
}
563563
if (success) return;
564564
}
565+
if (["ECONNABORTED", "ERR_CANCELED"].includes(error?.code)) {
566+
error = `Request timed out; server took longer than ${serverInfoTimeout} ms to respond.`;
567+
message = `Request timed out after ${serverInfoTimeout} ms`;
568+
}
565569
handleError(
566570
errorMessage ?? error,
567571
`Failed to connect to server '${api.serverId}'. Check your server configuration.`
@@ -843,9 +847,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
843847
continue;
844848
}
845849
}
846-
for await (const workspaceFolder of vscode.workspace.workspaceFolders ?? []) {
847-
await addWsServerRootFolderData(workspaceFolder.uri);
848-
}
850+
await Promise.allSettled(
851+
vscode.workspace.workspaceFolders?.map((wsFolder) => addWsServerRootFolderData(wsFolder.uri)) || []
852+
);
849853

850854
xmlContentProvider = new XmlContentProvider();
851855

@@ -1383,9 +1387,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
13831387
const serverName = notIsfs(uri) ? config("conn", configName).server : configName;
13841388
await resolveConnectionSpec(serverName);
13851389
}
1386-
for await (const workspaceFolder of added) {
1387-
await addWsServerRootFolderData(workspaceFolder.uri);
1388-
}
1390+
await Promise.allSettled(added.map((wsFolder) => addWsServerRootFolderData(wsFolder.uri)));
13891391
}),
13901392
vscode.workspace.onDidChangeConfiguration(async ({ affectsConfiguration }) => {
13911393
if (affectsConfiguration("objectscript.conn") || affectsConfiguration("intersystems.servers")) {
@@ -1440,39 +1442,33 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
14401442
}),
14411443
vscode.window.onDidChangeActiveTextEditor(async (textEditor: vscode.TextEditor) => {
14421444
if (!textEditor) return;
1443-
posPanel.text = "";
14441445
await checkConnection(false, textEditor.document.uri);
14451446
if (textEditor.document.uri.path.toLowerCase().endsWith(".xml") && config("autoPreviewXML")) {
14461447
return previewXMLAsUDL(textEditor, true);
14471448
}
14481449
}),
1449-
vscode.window.onDidChangeTextEditorSelection((event: vscode.TextEditorSelectionChangeEvent) => {
1450+
vscode.window.onDidChangeTextEditorSelection(async (event: vscode.TextEditorSelectionChangeEvent) => {
14501451
const document = event.textEditor.document;
1451-
1452-
// Avoid losing position indicator if event came from output channel
1453-
if (document.uri.scheme == "output") {
1454-
return;
1455-
}
1456-
posPanel.text = "";
1457-
if (![macLangId, intLangId].includes(document.languageId)) {
1458-
return;
1459-
}
1460-
if (event.selections.length > 1 || !event.selections[0].isEmpty) {
1461-
return;
1462-
}
1463-
1464-
const file = currentFile(document);
1465-
const nameMatch = file.name.match(/(.*)\.(int|mac)$/i);
1466-
if (!nameMatch) {
1467-
return;
1468-
}
1469-
const [, routine] = nameMatch;
1470-
let label = "";
1471-
let pos = 0;
1472-
vscode.commands
1473-
.executeCommand<vscode.DocumentSymbol[]>("vscode.executeDocumentSymbolProvider", document.uri)
1474-
.then((symbols) => {
1475-
if (symbols != undefined) {
1452+
// Avoid losing position indicator if event came from output channel or a non-active editor
1453+
if (document.uri.scheme == "output" || vscode.window.activeTextEditor != event.textEditor) return;
1454+
try {
1455+
if (
1456+
![macLangId, intLangId].includes(document.languageId) ||
1457+
event.selections.length > 1 ||
1458+
!event.selections[0].isEmpty
1459+
) {
1460+
throw undefined;
1461+
}
1462+
const file = currentFile(document);
1463+
const nameMatch = file.name.match(/(.*)\.(int|mac)$/i);
1464+
if (!nameMatch) throw undefined;
1465+
const [, routine] = nameMatch;
1466+
let label = "";
1467+
let pos = 0;
1468+
await vscode.commands
1469+
.executeCommand<vscode.DocumentSymbol[]>("vscode.executeDocumentSymbolProvider", document.uri)
1470+
.then((symbols) => {
1471+
if (!symbols) throw undefined;
14761472
const cursor = event.selections[0].active;
14771473
if (symbols.length == 0 || cursor.isBefore(symbols[0].range.start)) {
14781474
pos = cursor.line - 1;
@@ -1486,8 +1482,12 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
14861482
}
14871483
}
14881484
posPanel.text = `${label}${pos > 0 ? "+" + pos : ""}^${routine}`;
1489-
}
1490-
});
1485+
});
1486+
} catch {
1487+
// If we couldn't resolve the cursor location to a label+offset^routine
1488+
// for any reason, hide the status bar item
1489+
posPanel.text = "";
1490+
}
14911491
}),
14921492
vscode.commands.registerCommand("vscode-objectscript.loadStudioSnippets", loadStudioSnippets),
14931493
vscode.commands.registerCommand("vscode-objectscript.loadStudioColors", () => {

src/providers/FileSystemProvider/FileSystemProvider.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
504504
})
505505
.catch((error) => {
506506
// Throw all failures
507-
throw vscode.FileSystemError.Unavailable(stringifyError(error) || uri);
507+
const errorStr = stringifyError(error);
508+
throw errorStr ? errorStr : vscode.FileSystemError.Unavailable(uri);
508509
});
509510
},
510511
(error) => {
@@ -527,7 +528,8 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
527528
)
528529
.catch((error) => {
529530
// Throw all failures
530-
throw vscode.FileSystemError.Unavailable(stringifyError(error) || uri);
531+
const errorStr = stringifyError(error);
532+
throw errorStr ? errorStr : vscode.FileSystemError.Unavailable(uri);
531533
})
532534
.then((data) => {
533535
// New file has been written
@@ -771,7 +773,8 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
771773
)
772774
.catch((error) => {
773775
// Throw all failures
774-
throw vscode.FileSystemError.Unavailable(stringifyError(error) || newUri);
776+
const errorStr = stringifyError(error);
777+
throw errorStr ? errorStr : vscode.FileSystemError.Unavailable(newUri);
775778
})
776779
.then(async (response) => {
777780
// New file has been written
@@ -985,9 +988,12 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
985988
)
986989
.catch((error) => {
987990
if (error?.statusCode == 304 && cachedFile) return cachedFile;
988-
const errArg = stringifyError(error) || uri;
989-
if (error?.statusCode == 404) throw vscode.FileSystemError.FileNotFound(errArg);
990-
throw vscode.FileSystemError.Unavailable(errArg);
991+
const errorStr = stringifyError(error);
992+
throw error?.statusCode == 404
993+
? vscode.FileSystemError.FileNotFound(uri)
994+
: errorStr
995+
? errorStr
996+
: vscode.FileSystemError.Unavailable(uri);
991997
});
992998
}
993999

0 commit comments

Comments
 (0)