Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SEU color support and related configurations #2482

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
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
Loading