Commit 27c6efdd authored by yann300's avatar yann300

fix import external

parent 7be40bff
...@@ -217,19 +217,7 @@ This instance of Remix you are visiting WILL NOT BE UPDATED.\n ...@@ -217,19 +217,7 @@ This instance of Remix you are visiting WILL NOT BE UPDATED.\n
Please make a backup of your contracts and start using http://remix.ethereum.org`) Please make a backup of your contracts and start using http://remix.ethereum.org`)
} }
// ----------------- Compiler ----------------- function importExternal (url, cb) {
var compiler = new Compiler((url, cb) => {
var provider = fileManager.fileProviderOf(url)
if (provider) {
provider.exists(url, (error, exist) => {
if (error) return cb(error)
if (exist) {
return provider.get(url, cb)
} else {
return cb('Unable to import "' + url + '": File not found')
}
})
} else {
handleImports.import(url, handleImports.import(url,
(loadingMsg) => { (loadingMsg) => {
$('#output').append($('<div/>').append($('<pre/>').text(loadingMsg))) $('#output').append($('<div/>').append($('<pre/>').text(loadingMsg)))
...@@ -243,6 +231,22 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -243,6 +231,22 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
} }
}) })
} }
// ----------------- Compiler -----------------
var compiler = new Compiler((url, cb) => {
var provider = fileManager.fileProviderOf(url)
if (provider) {
provider.exists(url, (error, exist) => {
if (error) return cb(error)
if (exist) {
return provider.get(url, cb)
} else {
importExternal(url, cb)
}
})
} else {
importExternal(url, cb)
}
}) })
var offsetToLineColumnConverter = new OffsetToLineColumnConverter(compiler.event) var offsetToLineColumnConverter = new OffsetToLineColumnConverter(compiler.event)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment