Skip to content

Commit

Permalink
Remove SEU color support and related configurations
Browse files Browse the repository at this point in the history
Signed-off-by: worksofliam <[email protected]>
  • Loading branch information
worksofliam committed Jan 25, 2025
1 parent 2848a5f commit f5fb615
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 340 deletions.
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,6 @@
"default": true,
"description": "If enabled, will log spool files from command executed. You can find it under Output for 'IBM i Compile Log'."
},
"code-for-ibmi.showSeuColors": {
"type": "boolean",
"default": false,
"description": "If enabled, will colourise lines like SEU. Only supports source members. Requires restart if changed."
},
"code-for-ibmi.clearOutputEveryTime": {
"type": "boolean",
"default": true,
Expand Down
34 changes: 7 additions & 27 deletions src/filesystems/qsys/extendedContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ const writeFileAsync = util.promisify(fs.writeFile);

const DEFAULT_RECORD_LENGTH = 80;

// Translate x'25' to x'2F' and back, or x'25' will become x'0A' (linefeed)!
const SEU_GREEN_UL_RI = `x'25'`;
const SEU_GREEN_UL_RI_temp = `x'2F'`;

export class ExtendedIBMiContent {
constructor(readonly sourceDateHandler: SourceDateHandler) {

Expand All @@ -33,7 +29,6 @@ export class ExtendedIBMiContent {
const config = instance.getConfig();
const connection = instance.getConnection();
if (connection && config && content) {
const sourceColourSupport = IBMi.connectionManager.get<boolean>(`showSeuColors`);
const tempLib = config.tempLibrary;
const alias = getAliasName(uri);
const aliasPath = `${tempLib}.${alias}`;
Expand All @@ -49,17 +44,10 @@ export class ExtendedIBMiContent {
this.sourceDateHandler.recordLengths.set(alias, recordLength);
}

let rows;
if (sourceColourSupport)
rows = await connection.runSQL(
`select srcdat, rtrim(translate(srcdta, ${SEU_GREEN_UL_RI_temp}, ${SEU_GREEN_UL_RI})) as srcdta from ${aliasPath}`,
{forceSafe: true}
);
else
rows = await connection.runSQL(
`select srcdat, srcdta from ${aliasPath}`,
{forceSafe: true}
);
let rows = await connection.runSQL(
`select srcdat, srcdta from ${aliasPath}`,
{forceSafe: true}
);

if (rows.length === 0) {
rows.push({
Expand Down Expand Up @@ -133,7 +121,6 @@ export class ExtendedIBMiContent {
const { library, file, name } = connection.parserMemberPath(uri.path);
const tempRmt = connection.getTempRemote(library + file + name);
if (tempRmt) {
const sourceColourSupport = IBMi.connectionManager.get<boolean>(`showSeuColors`);
const tmpobj = await tmpFile();

const sourceData = body.split(`\n`);
Expand All @@ -150,16 +137,9 @@ export class ExtendedIBMiContent {
sourceData[i] = sourceData[i].substring(0, recordLength);
}

// We only want to do the translate when source colours at enabled.
// For large sources, translate adds a bunch of time to the saving process.
if (sourceColourSupport)
rows.push(
`(${sequence}, ${sourceDates[i] ? sourceDates[i].padEnd(6, `0`) : `0`}, translate('${escapeString(sourceData[i])}', ${SEU_GREEN_UL_RI}, ${SEU_GREEN_UL_RI_temp}))`,
);
else
rows.push(
`(${sequence}, ${sourceDates[i] ? sourceDates[i].padEnd(6, `0`) : `0`}, '${escapeString(sourceData[i])}')`,
);
rows.push(
`(${sequence}, ${sourceDates[i] ? sourceDates[i].padEnd(6, `0`) : `0`}, '${escapeString(sourceData[i])}')`,
);

}

Expand Down
6 changes: 0 additions & 6 deletions src/instantiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { registerConnectionCommands } from './commands/connection';
import { registerOpenCommands } from './commands/open';
import { registerPasswordCommands } from './commands/password';
import { QSysFS } from "./filesystems/qsys/QSysFs";
import { SEUColorProvider } from "./languages/general/SEUColorProvider";
import { ActionsUI } from './webviews/actions';
import { VariablesUI } from "./webviews/variables";
import IBMi from "./api/IBMi";
Expand Down Expand Up @@ -97,11 +96,6 @@ export async function loadAllofExtension(context: vscode.ExtensionContext) {
})
);

// Color provider
if (IBMi.connectionManager.get<boolean>(`showSeuColors`)) {
SEUColorProvider.intitialize(context);
}

// Register git events based on workspace folders
if (vscode.workspace.workspaceFolders) {
setupGitEventHandler(context);
Expand Down
80 changes: 0 additions & 80 deletions src/languages/general/SEUColorProvider.ts

This file was deleted.

Loading

0 comments on commit f5fb615

Please sign in to comment.