Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
369531aa
Commit
369531aa
authored
Sep 30, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync remixd events
parent
2ab939cd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
12 deletions
+21
-12
remixd.test.ts
apps/remix-ide-e2e/src/tests/remixd.test.ts
+0
-1
remixDProvider.js
apps/remix-ide/src/app/files/remixDProvider.js
+13
-3
events.ts
libs/remix-ui/workspace/src/lib/actions/events.ts
+8
-8
No files found.
apps/remix-ide-e2e/src/tests/remixd.test.ts
View file @
369531aa
...
@@ -76,7 +76,6 @@ module.exports = {
...
@@ -76,7 +76,6 @@ module.exports = {
.
addFile
(
'test_import_node_modules_with_github_import.sol'
,
sources
[
4
][
'test_import_node_modules_with_github_import.sol'
])
.
addFile
(
'test_import_node_modules_with_github_import.sol'
,
sources
[
4
][
'test_import_node_modules_with_github_import.sol'
])
.
clickLaunchIcon
(
'solidity'
)
.
clickLaunchIcon
(
'solidity'
)
.
setSolidityCompilerVersion
(
'soljson-v0.8.0+commit.c7dfd78e.js'
)
// open-zeppelin moved to pragma ^0.8.0
.
setSolidityCompilerVersion
(
'soljson-v0.8.0+commit.c7dfd78e.js'
)
// open-zeppelin moved to pragma ^0.8.0
.
pause
(
10000
)
.
testContracts
(
'test_import_node_modules_with_github_import.sol'
,
sources
[
4
][
'test_import_node_modules_with_github_import.sol'
],
[
'ERC20'
,
'test11'
])
.
testContracts
(
'test_import_node_modules_with_github_import.sol'
,
sources
[
4
][
'test_import_node_modules_with_github_import.sol'
],
[
'ERC20'
,
'test11'
])
},
},
'Static Analysis run with remixd'
:
function
(
browser
)
{
'Static Analysis run with remixd'
:
function
(
browser
)
{
...
...
apps/remix-ide/src/app/files/remixDProvider.js
View file @
369531aa
...
@@ -15,9 +15,9 @@ module.exports = class RemixDProvider extends FileProvider {
...
@@ -15,9 +15,9 @@ module.exports = class RemixDProvider extends FileProvider {
_registerEvent
()
{
_registerEvent
()
{
var
remixdEvents
=
[
'connecting'
,
'connected'
,
'errored'
,
'closed'
]
var
remixdEvents
=
[
'connecting'
,
'connected'
,
'errored'
,
'closed'
]
remixdEvents
.
forEach
((
value
)
=>
{
remixdEvents
.
forEach
((
event
)
=>
{
this
.
_appManager
.
on
(
'remixd'
,
value
,
(
event
)
=>
{
this
.
_appManager
.
on
(
'remixd'
,
event
,
(
value
)
=>
{
this
.
event
.
emit
(
value
,
event
)
this
.
event
.
emit
(
event
,
value
)
})
})
})
})
...
@@ -44,6 +44,16 @@ module.exports = class RemixDProvider extends FileProvider {
...
@@ -44,6 +44,16 @@ module.exports = class RemixDProvider extends FileProvider {
this
.
_appManager
.
on
(
'remixd'
,
'rootFolderChanged'
,
(
path
)
=>
{
this
.
_appManager
.
on
(
'remixd'
,
'rootFolderChanged'
,
(
path
)
=>
{
this
.
event
.
emit
(
'rootFolderChanged'
,
path
)
this
.
event
.
emit
(
'rootFolderChanged'
,
path
)
})
})
this
.
_appManager
.
on
(
'remixd'
,
'removed'
,
(
path
)
=>
{
this
.
event
.
emit
(
'fileRemoved'
,
path
)
})
this
.
_appManager
.
on
(
'remixd'
,
'changed'
,
(
path
)
=>
{
this
.
get
(
path
,
(
_error
,
content
)
=>
{
this
.
event
.
emit
(
'fileExternallyChanged'
,
path
,
content
)
})
})
}
}
isConnected
()
{
isConnected
()
{
...
...
libs/remix-ui/workspace/src/lib/actions/events.ts
View file @
369531aa
...
@@ -39,7 +39,7 @@ export const listenOnPluginEvents = (filePanelPlugin) => {
...
@@ -39,7 +39,7 @@ export const listenOnPluginEvents = (filePanelPlugin) => {
})
})
}
}
export
const
listenOnProviderEvents
=
(
provider
)
=>
async
(
reducerDispatch
:
React
.
Dispatch
<
any
>
)
=>
{
export
const
listenOnProviderEvents
=
(
provider
)
=>
(
reducerDispatch
:
React
.
Dispatch
<
any
>
)
=>
{
dispatch
=
reducerDispatch
dispatch
=
reducerDispatch
provider
.
event
.
on
(
'fileAdded'
,
(
filePath
:
string
)
=>
{
provider
.
event
.
on
(
'fileAdded'
,
(
filePath
:
string
)
=>
{
...
@@ -70,7 +70,7 @@ export const listenOnProviderEvents = (provider) => async (reducerDispatch: Reac
...
@@ -70,7 +70,7 @@ export const listenOnProviderEvents = (provider) => async (reducerDispatch: Reac
},
10
)
},
10
)
})
})
provider
.
event
.
on
(
'connected'
,
async
()
=>
{
provider
.
event
.
on
(
'connected'
,
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
plugin
.
fileManager
.
setMode
(
'localhost'
)
plugin
.
fileManager
.
setMode
(
'localhost'
)
dispatch
(
setMode
(
'localhost'
))
dispatch
(
setMode
(
'localhost'
))
...
@@ -79,33 +79,33 @@ export const listenOnProviderEvents = (provider) => async (reducerDispatch: Reac
...
@@ -79,33 +79,33 @@ export const listenOnProviderEvents = (provider) => async (reducerDispatch: Reac
},
10
)
},
10
)
})
})
provider
.
event
.
on
(
'loadingLocalhost'
,
async
()
=>
{
provider
.
event
.
on
(
'loadingLocalhost'
,
()
=>
{
setTimeout
(
async
()
=>
{
setTimeout
(
async
()
=>
{
await
switchToWorkspace
(
LOCALHOST
)
await
switchToWorkspace
(
LOCALHOST
)
dispatch
(
loadLocalhostRequest
())
dispatch
(
loadLocalhostRequest
())
},
10
)
},
10
)
})
})
provider
.
event
.
on
(
'fileExternallyChanged'
,
async
(
path
:
string
,
file
:
{
content
:
string
}
)
=>
{
provider
.
event
.
on
(
'fileExternallyChanged'
,
(
path
:
string
,
content
:
string
)
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
config
=
plugin
.
registry
.
get
(
'config'
).
api
const
config
=
plugin
.
registry
.
get
(
'config'
).
api
const
editor
=
plugin
.
registry
.
get
(
'editor'
).
api
const
editor
=
plugin
.
registry
.
get
(
'editor'
).
api
if
(
config
.
get
(
'currentFile'
)
===
path
&&
editor
.
currentContent
()
!==
file
.
content
)
{
if
(
config
.
get
(
'currentFile'
)
===
path
&&
editor
.
currentContent
()
!==
content
)
{
if
(
provider
.
isReadOnly
(
path
))
return
editor
.
setText
(
file
.
content
)
if
(
provider
.
isReadOnly
(
path
))
return
editor
.
setText
(
content
)
dispatch
(
displayNotification
(
dispatch
(
displayNotification
(
path
+
' changed'
,
path
+
' changed'
,
'This file has been changed outside of Remix IDE.'
,
'This file has been changed outside of Remix IDE.'
,
'Replace by the new content'
,
'Keep the content displayed in Remix'
,
'Replace by the new content'
,
'Keep the content displayed in Remix'
,
()
=>
{
()
=>
{
editor
.
setText
(
file
.
content
)
editor
.
setText
(
content
)
}
}
))
))
}
}
},
10
)
},
10
)
})
})
provider
.
event
.
on
(
'fileRenamedError'
,
async
()
=>
{
provider
.
event
.
on
(
'fileRenamedError'
,
()
=>
{
setTimeout
(()
=>
dispatch
(
displayNotification
(
'File Renamed Failed'
,
''
,
'Ok'
,
'Cancel'
)),
10
)
setTimeout
(()
=>
dispatch
(
displayNotification
(
'File Renamed Failed'
,
''
,
'Ok'
,
'Cancel'
)),
10
)
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment