Skip to content

Commit

Permalink
Remove requirement for Code for IBM i
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam committed Dec 5, 2021
1 parent ec2441b commit 7c48ea0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
"onStartupFinished",
"onLanguage:rpgle"
],
"extensionDependencies": [
"HalcyonTechLtd.code-for-ibmi"
],
"main": "./dist/extension",
"contributes": {
"snippets": [
Expand Down
9 changes: 8 additions & 1 deletion src/columnAssist.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const vscode = require(`vscode`);

const Configuration = require(`./configuration`);

const { CustomUI, Field } = vscode.extensions.getExtension(`halcyontechltd.code-for-ibmi`).exports;
const base = vscode.extensions.getExtension(`halcyontechltd.code-for-ibmi`);

const currentArea = vscode.window.createTextEditorDecorationType({
backgroundColor: `rgba(242, 242, 109, 0.3)`,
Expand Down Expand Up @@ -67,6 +67,13 @@ const getAreasForLine = (line, index) => {
* @returns {Promise<string|undefined>} New line
*/
const promptLine = async (line, index) => {
if (!base) {
vscode.window.showErrorMessage(`Code for IBMi is not installed. It is required due to required UI tools.`);
return undefined;
};

const { CustomUI, Field } = base.exports;

if (line.length < 6) return undefined;
if (line[6] === `*`) return undefined;
line = line.padEnd(80);
Expand Down

0 comments on commit 7c48ea0

Please sign in to comment.