diff --git a/apps/remix-ide/src/app/tabs/analysis-tab.js b/apps/remix-ide/src/app/tabs/analysis-tab.js index e9efe9f302..a42d2a5113 100644 --- a/apps/remix-ide/src/app/tabs/analysis-tab.js +++ b/apps/remix-ide/src/app/tabs/analysis-tab.js @@ -39,7 +39,11 @@ class AnalysisTab extends ViewPlugin { } } - onActivation () { + async onActivation () { + const isSolidityActive = await this.call('manager', 'isActive', 'solidity') + if (!isSolidityActive) { + await this.call('manager', 'activatePlugin', 'solidity') + } this.renderComponent() } diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index a41667bf3a..df001652ba 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -48,6 +48,7 @@ module.exports = class TestTab extends ViewPlugin { appManager.event.on('activate', (name) => { if (name === 'solidity') this.updateRunAction() + console.log('solidity is activated') }) appManager.event.on('deactivate', (name) => { if (name === 'solidity') this.updateRunAction() @@ -74,6 +75,14 @@ module.exports = class TestTab extends ViewPlugin { } } + async onActivation () { + const isSolidityActive = await this.call('manager', 'isActive', 'solidity') + if (!isSolidityActive) { + await this.call('manager', 'activatePlugin', 'solidity') + } + this.updateRunAction() + } + onDeactivation () { this.off('filePanel', 'newTestFileCreated') this.off('filePanel', 'setWorkspace') @@ -637,7 +646,6 @@ module.exports = class TestTab extends ViewPlugin { el.setAttribute('title', 'No solidity file selected') } else { el.setAttribute('title', 'The "Solidity Plugin" should be activated') - // @todo(#2747) we can activate the plugin here } } if (!this.runActionElement) { diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 8f4187cc98..f834990ac5 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -14,7 +14,7 @@ const requiredModules = [ // services + layout views + system views const dependentModules = ['git', 'hardhat'] // module which shouldn't be manually activated (e.g git is activated by remixd) export function isNative (name) { - const nativePlugins = ['vyper', 'workshops', 'debugger', 'remixd', 'menuicons', 'solidity', 'hardhat-provider'] + const nativePlugins = ['vyper', 'workshops', 'debugger', 'remixd', 'menuicons', 'solidity', 'hardhat-provider', 'solidityStaticAnalysis', 'solidityUnitTesting'] return nativePlugins.includes(name) || requiredModules.includes(name) } diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 062016312b..e70bde21db 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -82,7 +82,7 @@ commander const baseURL = 'https://binaries.soliditylang.org/wasm/' const response: AxiosResponse = await axios.get(baseURL + 'list.json') const { releases, latestRelease } = response.data - const compString = releases[compVersion] + const compString = releases ? releases[compVersion] : null if (!compString) { log.error(`No compiler found in releases with version ${compVersion}`) process.exit() diff --git a/libs/remixd/src/bin/remixd.ts b/libs/remixd/src/bin/remixd.ts index 1e0e241f5f..b57c31f6b6 100644 --- a/libs/remixd/src/bin/remixd.ts +++ b/libs/remixd/src/bin/remixd.ts @@ -156,7 +156,8 @@ function errorHandler (error: any, service: string) { console.error(e) } - return data.includes(origin) ? data.includes(origin) : data.includes(domain) + const dataArray:string[] = data + return dataArray.includes(origin) ? dataArray.includes(origin) : dataArray.includes(domain) } catch (e) { try { // eslint-disable-next-line