refactor editor and offsettolinecolumnconverter

pull/573/head
yann300 4 years ago
parent b6aa14a6cc
commit 7122e1552b
  1. 5
      apps/remix-ide/src/app.js
  2. 7
      apps/remix-ide/src/app/tabs/debugger-tab.js
  3. 4
      libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx

@ -370,7 +370,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
registry.get('fileproviders/browser').api,
)
const analysis = new AnalysisTab(registry)
const debug = new DebuggerTab(blockchain)
const debug = new DebuggerTab(
blockchain,
registry.get('editor').api,
registry.get('offsettolinecolumnconverter').api)
const test = new TestTab(
registry.get('filemanager').api,
registry.get('offsettolinecolumnconverter').api,

@ -22,12 +22,13 @@ const profile = {
class DebuggerTab extends ViewPlugin {
constructor (blockchain) {
super(profile)
constructor (blockchain, editor, offsettolinecolumnconverter) {
super(profile)
this.el = null
this.editor = editor
this.offsetToLineColumnConverter = offsettolinecolumnconverter
this.blockchain = blockchain
this.debugHash = null
this.getTraceHash = null
this.removeHighlights = false
}

@ -44,7 +44,7 @@ export const DebuggerUI = ({ debuggerModule }) => {
useEffect(() => {
const setEditor = () => {
const editor = globalRegistry.get('editor').api
const editor = debuggerModule.editor
editor.event.register('breakpointCleared', (fileName, row) => {
if (state.debugger) state.debugger.breakPointManager.remove({fileName: fileName, row: row})
@ -173,7 +173,7 @@ export const DebuggerUI = ({ debuggerModule }) => {
const currentReceipt = await web3.eth.getTransactionReceipt(txNumber)
const debuggerInstance = new Debugger({
web3,
offsetToLineColumnConverter: globalRegistry.get('offsettolinecolumnconverter').api,
offsetToLineColumnConverter: debuggerModule.offsettolinecolumnconverter,
compilationResult: async (address) => {
try {
return await fetchContractAndCompile(address, currentReceipt)

Loading…
Cancel
Save