Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1449,11 +1449,6 @@
"default": false,
"description": "Controls whether synching a file to the server in a client-side workspace folder will always overwrite the server version, even if it changed since it was last accessed."
},
"objectscript.autoPreviewXML": {
"type": "boolean",
"default": false,
"description": "Automatically preview XML export files in UDL format."
},
"objectscript.format": {
"type": "object",
"description": "Formatting settings.",
Expand All @@ -1478,16 +1473,6 @@
}
}
},
"objectscript.suppressCompileMessages": {
"default": true,
"type": "boolean",
"description": "Suppress popup messages about successful compile."
},
"objectscript.suppressCompileErrorMessages": {
"default": false,
"type": "boolean",
"description": "Suppress popup messages about errors during compile, but still focus on Output view."
},
"objectscript.debug.debugThisMethod": {
"type": "boolean",
"default": true,
Expand All @@ -1498,11 +1483,6 @@
"default": true,
"markdownDescription": "Show inline `Copy Invocation` CodeLens action for ClassMethods and Routine Labels."
},
"objectscript.autoShowTerminal": {
"description": "Automatically show terminal when connected to docker-compose.",
"type": "boolean",
"default": false
},
"objectscript.compileOnSave": {
"description": "Automatically compile an InterSystems file when saved in the editor.",
"type": "boolean",
Expand All @@ -1519,11 +1499,6 @@
"type": "boolean",
"default": false
},
"objectscript.explorer.alwaysShowServerCopy": {
"description": "Always show the server copy of a document opened from the InterSystems Explorer.",
"type": "boolean",
"default": true
},
"objectscript.projects.webAppFileExtensions": {
"markdownDescription": "When browsing a virtual workspace folder that has a project query parameter, all files with these extensions will be automatically treated as web application files. Extensions added here will be appended to the default list and should **NOT** include a dot. See the [Settings Reference documentation page](https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GVSCO_settings#GVSCO_settings_objectscript) for a list of extensions included by default.",
"type": "array",
Expand All @@ -1534,16 +1509,6 @@
"pattern": "^[^.]+$"
}
},
"objectscript.showGeneratedFileDecorations": {
"description": "Controls whether a badge is shown in the file explorer and open editors view for generated files.",
"type": "boolean",
"default": true
},
"objectscript.webSocketTerminal.syntaxColoring": {
"description": "Enable syntax coloring for command input in the InterSystems Lite Terminal.",
"type": "boolean",
"default": true
},
"objectscript.showProposedApiPrompt": {
"description": "Controls whether a prompt to enable VS Code proposed APIs is shown when a server-side workspace folder is opened.",
"type": "boolean",
Expand Down
24 changes: 7 additions & 17 deletions src/commands/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ export async function compile(docs: (CurrentTextFile | CurrentBinaryFile)[], fla
const info = docs.length > 1 ? "" : `${docs[0].name}: `;
if (data.status && data.status.errors && data.status.errors.length) {
throw new Error(`${info}Compile error`);
} else if (!conf.get("suppressCompileMessages")) {
vscode.window.showInformationMessage(`${info}Compilation succeeded.`, "Dismiss");
}
if (wsFolder) {
// Make sure that we update the content for any
Expand All @@ -308,7 +306,7 @@ export async function compile(docs: (CurrentTextFile | CurrentBinaryFile)[], fla
return docs;
})
.catch(() => {
compileErrorMsg(conf);
compileErrorMsg();
// Always fetch server changes, even when compile failed or got cancelled
return docs;
})
Expand Down Expand Up @@ -407,17 +405,13 @@ export async function namespaceCompile(askFlags = false): Promise<any> {
.then((data) => {
if (data.status && data.status.errors && data.status.errors.length) {
throw new Error(`Compiling Namespace: ${api.ns} Error`);
} else if (!config("suppressCompileMessages")) {
vscode.window.showInformationMessage(`Compiling namespace ${api.ns} succeeded.`, "Dismiss");
}
})
.catch(() => {
if (!config("suppressCompileErrorMessages")) {
vscode.window.showErrorMessage(
`Compiling namespace '${api.ns}' failed. Check the 'ObjectScript' Output channel for details.`,
"Dismiss"
);
}
vscode.window.showErrorMessage(
`Compiling namespace '${api.ns}' failed. Check the 'ObjectScript' Output channel for details.`,
"Dismiss"
);
})
.then(() => {
// Always fetch server changes, even when compile failed or got cancelled
Expand Down Expand Up @@ -512,11 +506,9 @@ export async function compileExplorerItems(nodes: NodeBase[]): Promise<any> {
const info = nodes.length > 1 ? "" : `${nodes[0].fullName}: `;
if (data.status && data.status.errors && data.status.errors.length) {
throw new Error(`${info}Compile error`);
} else if (!conf.get("suppressCompileMessages")) {
vscode.window.showInformationMessage(`${info}Compilation succeeded.`, "Dismiss");
}
})
.catch(() => compileErrorMsg(conf))
.catch(() => compileErrorMsg())
);
}

Expand Down Expand Up @@ -601,11 +593,9 @@ async function promptForCompile(imported: string[], api: AtelierAPI, isIsfs: boo
const info = imported.length > 1 ? "" : `${imported[0]}: `;
if (data.status && data.status.errors && data.status.errors.length) {
throw new Error(`${info}Compile error`);
} else if (!conf.get("suppressCompileMessages")) {
vscode.window.showInformationMessage(`${info}Compilation succeeded.`, "Dismiss");
}
})
.catch(() => compileErrorMsg(conf))
.catch(() => compileErrorMsg())
.finally(() => {
if (isIsfs) {
// Refresh the files explorer to show the new files
Expand Down
5 changes: 1 addition & 4 deletions src/commands/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,6 @@ export async function exportProjectContents(node: ProjectNode | undefined): Prom

export async function compileProjectContents(node: ProjectNode): Promise<any> {
const { workspaceFolderUri, namespace, label } = node;
const conf = vscode.workspace.getConfiguration("objectscript", workspaceFolderUri);
const api = new AtelierAPI(workspaceFolderUri);
api.setNamespace(namespace);
const compileList: string[] = await api
Expand All @@ -992,11 +991,9 @@ export async function compileProjectContents(node: ProjectNode): Promise<any> {
.then((data) => {
if (data.status && data.status.errors && data.status.errors.length) {
throw new Error("Compile error");
} else if (!conf.get("suppressCompileMessages")) {
vscode.window.showInformationMessage("Compilation succeeded.", "Dismiss");
}
})
.catch(() => compileErrorMsg(conf))
.catch(() => compileErrorMsg())
);
}

Expand Down
19 changes: 7 additions & 12 deletions src/commands/webSocketTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
return openParen > 0 || openBrace > 0;
}

/** Checks if syntax coloring is enabled */
private _syntaxColoringEnabled(): boolean {
return vscode.workspace.getConfiguration("objectscript.webSocketTerminal").get("syntaxColoring");
}

/**
* Converts `_input` for use as `<commandline>` by VS Code shell integration sequence `OSC 633 ; E ; <commandline> ST`.
* See https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st
Expand Down Expand Up @@ -400,7 +395,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
this._input = inputArr.join("\r\n");
this._moveCursor(-1);
this._hideCursorWrite(`\x1b7\x1b[0J${trailingText}\x1b8`);
if (this._input != "" && this._state == "prompt" && this._syntaxColoringEnabled()) {
if (this._input != "" && this._state == "prompt") {
// Syntax color input
this._socket.send(JSON.stringify({ type: "color", input: this._input }));
}
Expand All @@ -419,7 +414,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
inputArr[inputArr.length - 1].slice(0, this._cursorCol - this._margin) + trailingText;
this._input = inputArr.join("\r\n");
this._hideCursorWrite(`\x1b7\x1b[0J${trailingText}\x1b8`);
if (this._input != "" && this._state == "prompt" && this._syntaxColoringEnabled()) {
if (this._input != "" && this._state == "prompt") {
// Syntax color input
this._socket.send(JSON.stringify({ type: "color", input: this._input }));
}
Expand Down Expand Up @@ -457,7 +452,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
this._moveCursor(this._margin - this._cursorCol);
this._hideCursorWrite(`\x1b[0J${this._input}`);
this._cursorCol = this._margin + this._input.length;
if (this._input != "" && this._syntaxColoringEnabled()) {
if (this._input != "") {
// Syntax color input
this._socket.send(JSON.stringify({ type: "color", input: this._input }));
}
Expand Down Expand Up @@ -490,7 +485,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
this._moveCursor(this._margin - this._cursorCol);
this._hideCursorWrite(`\x1b[0J${this._input}`);
this._cursorCol = this._margin + this._input.length;
if (this._input != "" && this._syntaxColoringEnabled()) {
if (this._input != "") {
// Syntax color input
this._socket.send(JSON.stringify({ type: "color", input: this._input }));
}
Expand Down Expand Up @@ -572,7 +567,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
this._hideCursorWrite("\x1b[0J");
inputArr[inputArr.length - 1] = "";
this._input = inputArr.join("\r\n");
if (this._input != "" && this._syntaxColoringEnabled()) {
if (this._input != "") {
// Syntax color input
this._socket.send(JSON.stringify({ type: "color", input: this._input }));
}
Expand Down Expand Up @@ -704,7 +699,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
this._input = "";
this._state = "eval";
this._margin = this._cursorCol = 0;
} else if (this._input != "" && this._state == "prompt" && this._syntaxColoringEnabled()) {
} else if (this._input != "" && this._state == "prompt") {
// Syntax color input
this._socket.send(JSON.stringify({ type: "color", input: this._input }));
}
Expand All @@ -730,7 +725,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
`\r\n${this.multiLinePrompt}`
)}\x1b8`
);
if (this._state == "prompt" && this._syntaxColoringEnabled()) {
if (this._state == "prompt") {
// Syntax color input
this._socket.send(JSON.stringify({ type: "color", input: this._input }));
}
Expand Down
28 changes: 8 additions & 20 deletions src/explorer/nodes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as vscode from "vscode";
import { AtelierAPI } from "../api";
import { cspApps, currentWorkspaceFolder, notIsfs, stringifyError, uriOfWorkspaceFolder } from "../utils";
import { cspApps, currentWorkspaceFolder, stringifyError, uriOfWorkspaceFolder } from "../utils";
import { StudioActions, OtherStudioAction } from "../commands/studio";
import { config, workspaceState } from "../extension";
import { workspaceState } from "../extension";
import { DocumentContentProvider } from "../providers/DocumentContentProvider";

interface NodeOptions {
Expand Down Expand Up @@ -272,22 +272,18 @@ export class ClassNode extends NodeBase {

public getTreeItem(): vscode.TreeItem {
const displayName: string = this.label;
const itemUri = getLeafNodeUri(this);
const isLocalFile = notIsfs(itemUri);
const showServerCopy: boolean = config("explorer.alwaysShowServerCopy", this.workspaceFolder);
const serverCopyUri = getLeafNodeUri(this, true);

return {
collapsibleState: vscode.TreeItemCollapsibleState.None,
command: {
arguments: [isLocalFile && !showServerCopy ? itemUri : serverCopyUri, this.options.project, this.fullName],
arguments: [serverCopyUri, this.options.project, this.fullName],
command: "vscode-objectscript.explorer.open",
title: "Open Class",
},
resourceUri: isLocalFile && !showServerCopy ? itemUri : undefined,
contextValue: "dataNode:classNode",
label: `${displayName}`,
tooltip: isLocalFile && !showServerCopy ? undefined : this.fullName,
tooltip: this.fullName,
};
}
}
Expand All @@ -300,22 +296,18 @@ export class CSPFileNode extends NodeBase {

public getTreeItem(): vscode.TreeItem {
const displayName: string = this.label;
const itemUri = getLeafNodeUri(this);
const isLocalFile = notIsfs(itemUri);
const showServerCopy: boolean = config("explorer.alwaysShowServerCopy", this.workspaceFolder);
const serverCopyUri = getLeafNodeUri(this, true);

return {
collapsibleState: vscode.TreeItemCollapsibleState.None,
command: {
arguments: [isLocalFile && !showServerCopy ? itemUri : serverCopyUri, this.options.project, this.fullName],
arguments: [serverCopyUri, this.options.project, this.fullName],
command: "vscode-objectscript.explorer.open",
title: "Open File",
},
resourceUri: isLocalFile && !showServerCopy ? itemUri : undefined,
contextValue: CSPFileNode.contextValue,
label: `${displayName}`,
tooltip: isLocalFile && !showServerCopy ? undefined : this.fullName,
tooltip: this.fullName,
};
}
}
Expand Down Expand Up @@ -349,22 +341,18 @@ export class RoutineNode extends NodeBase {

public getTreeItem(): vscode.TreeItem {
const displayName: string = this.label;
const itemUri = getLeafNodeUri(this);
const isLocalFile = notIsfs(itemUri);
const showServerCopy: boolean = config("explorer.alwaysShowServerCopy", this.workspaceFolder);
const serverCopyUri = getLeafNodeUri(this, true);

return {
collapsibleState: vscode.TreeItemCollapsibleState.None,
command: {
arguments: [isLocalFile && !showServerCopy ? itemUri : serverCopyUri, this.options.project, this.fullName],
arguments: [serverCopyUri, this.options.project, this.fullName],
command: "vscode-objectscript.explorer.open",
title: "Open Routine",
},
resourceUri: isLocalFile && !showServerCopy ? itemUri : undefined,
contextValue: "dataNode:routineNode",
label: `${displayName}`,
tooltip: isLocalFile && !showServerCopy ? undefined : this.fullName,
tooltip: this.fullName,
};
}
}
Expand Down
16 changes: 1 addition & 15 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ import {
currentWorkspaceFolder,
outputChannel,
portFromDockerCompose,
terminalWithDocker,
notNull,
currentFile,
isUnauthenticated,
Expand Down Expand Up @@ -403,8 +402,6 @@ export async function checkConnection(
panel.tooltip = `ERROR - ${errorMessage}`;
return;
}
const { autoShowTerminal } = config();
autoShowTerminal && terminalWithDocker();
if (dockerPort !== port) {
workspaceState.update(wsKey + ":host", "localhost");
workspaceState.update(wsKey + ":port", dockerPort);
Expand Down Expand Up @@ -836,9 +833,6 @@ export function sendDebuggerTelemetryEvent(debugType: string): void {
export function sendLiteTerminalTelemetryEvent(terminalOrigin: string): void {
reporter?.sendTelemetryEvent("liteTerminalStarted", {
terminalOrigin,
"config.webSocketTerminal.syntaxColoring": String(
vscode.workspace.getConfiguration("objectscript.webSocketTerminal").get("syntaxColoring")
),
});
}

Expand Down Expand Up @@ -1117,9 +1111,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
const conf = vscode.workspace.getConfiguration("objectscript");
const uriString = editor.document.uri.toString();
await checkConnection(false, editor.document.uri);
if (conf.get("autoPreviewXML") && editor.document.uri.path.toLowerCase().endsWith("xml")) {
previewXMLAsUDL(editor, true);
} else if (
if (
conf.get("openClassContracted") &&
editor.document.languageId == clsLangId &&
!openedClasses.includes(uriString)
Expand Down Expand Up @@ -1931,12 +1923,6 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
reporter?.sendTelemetryEvent("extensionActivated", {
languageServerVersion: languageServerExt?.packageJSON.version,
serverManagerVersion: smExt?.packageJSON.version,
"config.explorer.alwaysShowServerCopy": String(conf.get("explorer.alwaysShowServerCopy")),
"config.autoShowTerminal": String(conf.get("autoShowTerminal")),
"config.suppressCompileMessages": String(conf.get("suppressCompileMessages")),
"config.suppressCompileErrorMessages": String(conf.get("suppressCompileErrorMessages")),
"config.autoPreviewXML": String(conf.get("autoPreviewXML")),
"config.showGeneratedFileDecorations": String(conf.get("showGeneratedFileDecorations")),
"config.showProposedApiPrompt": String(conf.get("showProposedApiPrompt")),
"config.unitTest.enabled": String(conf.get("unitTest.enabled")),
});
Expand Down
9 changes: 1 addition & 8 deletions src/providers/FileDecorationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ export class FileDecorationProvider implements vscode.FileDecorationProvider {

// Only provide decorations for files that are open and not untitled
const doc = vscode.workspace.textDocuments.find((d) => d.uri.toString() == uri.toString());
if (
doc != undefined &&
!doc.isUntitled &&
[clsLangId, macLangId, intLangId, cspLangId].includes(doc.languageId) &&
vscode.workspace
.getConfiguration("objectscript", vscode.workspace.getWorkspaceFolder(uri))
.get<boolean>("showGeneratedFileDecorations")
) {
if (doc != undefined && !doc.isUntitled && [clsLangId, macLangId, intLangId, cspLangId].includes(doc.languageId)) {
// Use the file's contents to check if it's generated
if (doc.languageId == clsLangId) {
for (let line = 0; line < doc.lineCount; line++) {
Expand Down
4 changes: 1 addition & 3 deletions src/providers/FileSystemProvider/FileSystemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,12 +911,10 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
const info = compileList.length > 1 ? "" : `${compileList}: `;
if (data.status && data.status.errors && data.status.errors.length) {
throw new Error(`${info}Compile error`);
} else if (!conf.get("suppressCompileMessages")) {
vscode.window.showInformationMessage(`${info}Compilation succeeded.`, "Dismiss");
}
data.result.content.forEach((f) => filesToUpdate.push(f.name));
})
.catch(() => compileErrorMsg(conf))
.catch(() => compileErrorMsg())
);
if (file && (update || filesToUpdate.includes(file.fileName))) {
// This file was just written and the write may have changed its contents or the
Expand Down
Loading
Loading