diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 8528759d14..2b5a149d16 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -119,17 +119,17 @@ export const DebuggerApiMixin = (Base) => class extends Base { debug (hash) { this.debugHash = hash - this.onDebugRequestedListener(hash) + if (this.onDebugRequestedListener) this.onDebugRequestedListener(hash) } onActivation () { - this.on('editor', 'breakpointCleared', (fileName, row) => this.onBreakpointClearedListener(fileName, row)) - this.on('editor', 'breakpointAdded', (fileName, row) => this.onBreakpointAddedListener(fileName, row)) - this.on('editor', 'contentChanged', () => this.onEditorContentChangedListener()) + this.on('editor', 'breakpointCleared', (fileName, row) => { if (this.onBreakpointClearedListener) this.onBreakpointClearedListener(fileName, row) }) + this.on('editor', 'breakpointAdded', (fileName, row) => { if (this.onBreakpointAddedListener) this.onBreakpointAddedListener(fileName, row) }) + this.on('editor', 'contentChanged', () => { if (this.onEditorContentChangedListener) this.onEditorContentChangedListener() }) } onDeactivation () { - this.onRemoveHighlightsListener() + if (this.onRemoveHighlightsListener) this.onRemoveHighlightsListener() this.off('editor', 'breakpointCleared') this.off('editor', 'breakpointAdded') this.off('editor', 'contentChanged') diff --git a/apps/remix-ide/src/app/editor/editor.js b/apps/remix-ide/src/app/editor/editor.js index 88466a6e26..92b4b0cb8d 100644 --- a/apps/remix-ide/src/app/editor/editor.js +++ b/apps/remix-ide/src/app/editor/editor.js @@ -49,7 +49,7 @@ const profile = { name: 'editor', description: 'service - editor', version: packageJson.version, - methods: ['highlight', 'discardHighlight', 'discardHighlightAt', 'clearAnnotations', 'addAnnotation'] + methods: ['highlight', 'discardHighlight', 'discardHighlightAt', 'clearAnnotations', 'addAnnotation', 'gotoLine'] } class Editor extends Plugin { diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index 6d84a9721f..14ca4ae30e 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -52,15 +52,7 @@ class CompileTab extends ViewPlugin { eventHandlers: {}, loading: false } - this.compileTabLogic = new CompileTabLogic( - this.queryParams, - this.fileManager, - this.editor, - this.config, - this.fileProvider, - this.contentImport, - this.setCompileErrors.bind(this) - ) + this.compileTabLogic = new CompileTabLogic(this, this.contentImport) this.compiler = this.compileTabLogic.compiler this.compileTabLogic.init() this.contractMap = {} @@ -203,6 +195,10 @@ class CompileTab extends ViewPlugin { return this.compileTabLogic.compiler.state.lastCompilationResult } + addExternalFile (fileName, content) { + this.fileProvider.addExternal(fileName, content) + } + /** * compile using @arg fileName. * The module UI will be updated accordingly to the new compilation result. @@ -278,6 +274,50 @@ class CompileTab extends ViewPlugin { , this.el) } + getParameters () { + return this.queryParams.get() + } + + setParameters (params) { + this.queryParams.update(params) + } + + getConfiguration (name) { + return this.config.get(name) + } + + setConfiguration (name, value) { + this.config.set(name, value) + } + + fileProviderOf (fileName) { + return this.fileManager.fileProviderOf(fileName) + } + + getFileManagerMode () { + return this.fileManager.mode + } + + fileExists (fileName) { + return this.call('fileManager', 'exists', fileName) + } + + writeFile (fileName, content) { + return this.call('fileManager', 'writeFile', fileName, content) + } + + readFile (fileName) { + return this.call('fileManager', 'readFile', fileName) + } + + saveCurrentFile () { + return this.fileManager.saveCurrentFile() + } + + open (fileName) { + return this.call('fileManager', 'open', fileName) + } + onActivation () { this.call('manager', 'activatePlugin', 'solidity-logic') this.listenToEvents() diff --git a/apps/remix-ide/src/app/ui/TreeView.js b/apps/remix-ide/src/app/ui/TreeView.js index 413f49f667..a282cafbd6 100644 --- a/apps/remix-ide/src/app/ui/TreeView.js +++ b/apps/remix-ide/src/app/ui/TreeView.js @@ -27,7 +27,7 @@ var css = csjs` word-break: break-all; } .label_key { - min-width: 15%; + min-width: max-content; max-width: 80%; word-break: break-word; } diff --git a/apps/remix-ide/src/app/ui/landing-page/landing-page.js b/apps/remix-ide/src/app/ui/landing-page/landing-page.js index 60d762472f..744b5c988b 100644 --- a/apps/remix-ide/src/app/ui/landing-page/landing-page.js +++ b/apps/remix-ide/src/app/ui/landing-page/landing-page.js @@ -538,7 +538,6 @@ export class LandingPage extends ViewPlugin {