Merge pull request #947 from ethereum/fixRemixdWorkspace

Fix importing file using localhost
pull/966/head
yann300 4 years ago committed by GitHub
commit b7068d35f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  2. 4
      apps/remix-ide/src/app/compiler/compiler-imports.js
  3. 7
      apps/remix-ide/src/app/files/remixDProvider.js

@ -91,7 +91,7 @@ module.exports = {
.executeScript('remix.execute(\'resolveExternalUrlAndSave.js\')')
.pause(6000)
.journalLastChildIncludes('Implementation of the {IERC20} interface.')
.openFile('github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol')
.openFile('.deps/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol')
},
'Call Remix File Resolver (internal URL) from a script': function (browser: NightwatchBrowser) {
@ -114,7 +114,7 @@ module.exports = {
.executeScript('remix.execute(\'resolveExternalUrlAndSaveToaPath.js\')')
.pause(6000)
.journalLastChildIncludes('abstract contract ERC20Burnable')
.openFile('github/newFile.sol')
.openFile('.deps/github/newFile.sol')
.end()
},

@ -88,9 +88,9 @@ module.exports = class CompilerImports extends Plugin {
(error, content, cleanUrl, type, url) => {
if (error) return cb(error)
if (this.fileManager) {
const workspace = this.fileManager.getProvider('workspace')
const provider = this.fileManager.currentFileProvider()
const path = targetPath || type + '/' + cleanUrl
if (workspace) workspace.addExternal(path, content, url)
if (provider) provider.addExternal('.deps/' + path, content, url)
}
cb(null, content)
})

@ -1,11 +1,10 @@
'use strict'
var EventManager = require('../../lib/events')
const FileProvider = require('./fileProvider')
module.exports = class RemixDProvider {
module.exports = class RemixDProvider extends FileProvider {
constructor (appManager) {
this.event = new EventManager()
super('localhost')
this._appManager = appManager
this.type = 'localhost'
this.error = { EEXIST: 'File already exists' }
this._isReady = false
this._readOnlyFiles = {}

Loading…
Cancel
Save