diff --git a/package.json b/package.json index da49c69d..b509af74 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,6 @@ "onStartupFinished", "onLanguage:rpgle" ], - "extensionDependencies": [ - "HalcyonTechLtd.code-for-ibmi" - ], "main": "./dist/extension", "contributes": { "snippets": [ diff --git a/src/columnAssist.js b/src/columnAssist.js index c77b73b6..a4d06730 100644 --- a/src/columnAssist.js +++ b/src/columnAssist.js @@ -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)`, @@ -67,6 +67,13 @@ const getAreasForLine = (line, index) => { * @returns {Promise} 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);