From 98e0ad6d82ffb23cf7f01f68c4d8960e1a215a3a Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Mon, 15 Dec 2025 10:27:15 -0500 Subject: [PATCH] Remove barely used configuration settings --- package.json | 35 ------------------- src/commands/compile.ts | 24 ++++--------- src/commands/project.ts | 5 +-- src/commands/webSocketTerminal.ts | 19 ++++------ src/explorer/nodes.ts | 28 +++++---------- src/extension.ts | 16 +-------- src/providers/FileDecorationProvider.ts | 9 +---- .../FileSystemProvider/FileSystemProvider.ts | 4 +-- src/utils/index.ts | 3 +- 9 files changed, 27 insertions(+), 116 deletions(-) diff --git a/package.json b/package.json index 17811d6b..686400eb 100644 --- a/package.json +++ b/package.json @@ -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.", @@ -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, @@ -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", @@ -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", @@ -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", diff --git a/src/commands/compile.ts b/src/commands/compile.ts index 17e7e0f6..17f9cb4f 100644 --- a/src/commands/compile.ts +++ b/src/commands/compile.ts @@ -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 @@ -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; }) @@ -407,17 +405,13 @@ export async function namespaceCompile(askFlags = false): Promise { .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 @@ -512,11 +506,9 @@ export async function compileExplorerItems(nodes: NodeBase[]): Promise { 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()) ); } @@ -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 diff --git a/src/commands/project.ts b/src/commands/project.ts index 770ab676..ef54dd46 100644 --- a/src/commands/project.ts +++ b/src/commands/project.ts @@ -967,7 +967,6 @@ export async function exportProjectContents(node: ProjectNode | undefined): Prom export async function compileProjectContents(node: ProjectNode): Promise { 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 @@ -992,11 +991,9 @@ export async function compileProjectContents(node: ProjectNode): Promise { .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()) ); } diff --git a/src/commands/webSocketTerminal.ts b/src/commands/webSocketTerminal.ts index 986ab69b..6fe329df 100644 --- a/src/commands/webSocketTerminal.ts +++ b/src/commands/webSocketTerminal.ts @@ -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 `` by VS Code shell integration sequence `OSC 633 ; E ; ST`. * See https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st @@ -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 })); } @@ -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 })); } @@ -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 })); } @@ -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 })); } @@ -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 })); } @@ -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 })); } @@ -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 })); } diff --git a/src/explorer/nodes.ts b/src/explorer/nodes.ts index 79d9a5dd..46c666c9 100644 --- a/src/explorer/nodes.ts +++ b/src/explorer/nodes.ts @@ -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 { @@ -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, }; } } @@ -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, }; } } @@ -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, }; } } diff --git a/src/extension.ts b/src/extension.ts index c2c4f23a..10a86427 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -86,7 +86,6 @@ import { currentWorkspaceFolder, outputChannel, portFromDockerCompose, - terminalWithDocker, notNull, currentFile, isUnauthenticated, @@ -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); @@ -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") - ), }); } @@ -1117,9 +1111,7 @@ export async function activate(context: vscode.ExtensionContext): Promise { 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) @@ -1931,12 +1923,6 @@ export async function activate(context: vscode.ExtensionContext): Promise { 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")), }); diff --git a/src/providers/FileDecorationProvider.ts b/src/providers/FileDecorationProvider.ts index 6b73496d..3cf867fe 100644 --- a/src/providers/FileDecorationProvider.ts +++ b/src/providers/FileDecorationProvider.ts @@ -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("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++) { diff --git a/src/providers/FileSystemProvider/FileSystemProvider.ts b/src/providers/FileSystemProvider/FileSystemProvider.ts index 0a4ccc19..9afed7fc 100644 --- a/src/providers/FileSystemProvider/FileSystemProvider.ts +++ b/src/providers/FileSystemProvider/FileSystemProvider.ts @@ -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 diff --git a/src/utils/index.ts b/src/utils/index.ts index 5862bc3f..06d0a5d9 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1015,8 +1015,7 @@ export async function replaceFile(uri: vscode.Uri, content: string | string[] | } /** Show the compilation failure error message if required. */ -export function compileErrorMsg(conf: vscode.WorkspaceConfiguration): void { - if (conf.get("suppressCompileErrorMessages")) return; +export function compileErrorMsg(): void { vscode.window .showErrorMessage( "Compilation failed. Check 'ObjectScript' Output channel for details.",