Skip to content

Commit

Permalink
fix standard
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Dec 18, 2018
1 parent 6afbdaa commit 0d2287c
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class App {
self._adjustLayout('left', self.data._layout.left.offset)
self._adjustLayout('right', self.data._layout.right.offset)
return self._view.el
}
}
startdebugging (txHash) {
const self = this
self.event.trigger('debuggingRequested', [])
Expand Down Expand Up @@ -303,7 +303,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
}

registry.put({api: msg => self._components.editorpanel.logHtmlMessage(msg), name: 'logCallback'})

// helper for converting offset to line/column
var offsetToLineColumnConverter = new OffsetToLineColumnConverter()
registry.put({api: offsetToLineColumnConverter, name: 'offsettolinecolumnconverter'})
Expand Down
6 changes: 3 additions & 3 deletions src/app/editor/contextView.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ class ContextView {
let lastCompilationResult = self._deps.compilersArtefacts['__last']
if (lastCompilationResult && lastCompilationResult.data) {
var lineColumn = self._deps.offsetToLineColumnConverter.offsetToLineColumn(
position,
position.file,
lastCompilationResult.getSourceCode().sources,
position,
position.file,
lastCompilationResult.getSourceCode().sources,
lastCompilationResult.getAsts())
var filename = lastCompilationResult.getSourceName(position.file)
// TODO: refactor with rendererAPI.errorClick
Expand Down
2 changes: 1 addition & 1 deletion src/app/panels/file-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function filepanel (localRegistry) {
fileProviders: self._components.registry.get('fileproviders').api,
fileManager: self._components.registry.get('filemanager').api,
config: self._components.registry.get('config').api,
pluginManager: self._components.registry.get('pluginmanager').api,
pluginManager: self._components.registry.get('pluginmanager').api
}
var fileExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['browser'])
var fileSystemExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['localhost'])
Expand Down
2 changes: 1 addition & 1 deletion src/app/panels/righthand-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = class RighthandPanel {
}

var tabbedMenu = new TabbedMenu(self._components.registry)

self._components = {
tabbedMenu: tabbedMenu,
tabs
Expand Down
2 changes: 1 addition & 1 deletion src/app/plugin/pluginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = class PluginManager {
value: [ file ]
}))
})

txlistener.event.register('newTransaction', (tx) => {
self.broadcast(JSON.stringify({
action: 'notification',
Expand Down
6 changes: 3 additions & 3 deletions src/app/staticanalysis/staticAnalysisView.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ staticAnalysisView.prototype.run = function () {
start: parseInt(split[0]),
length: parseInt(split[1])
}
location = self._deps.offsetToLineColumnConverter.offsetToLineColumn(location,
parseInt(file),
self.lastCompilationSource.sources,
location = self._deps.offsetToLineColumnConverter.offsetToLineColumn(location,
parseInt(file),
self.lastCompilationSource.sources,
self.lastCompilationResult.sources)
location = Object.keys(self.lastCompilationResult.contracts)[file] + ':' + (location.start.line + 1) + ':' + (location.start.column + 1) + ':'
}
Expand Down
9 changes: 4 additions & 5 deletions src/app/tabs/compile-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var minixhr = require('minixhr')
var remixTests = require('remix-tests')
var Compiler = require('remix-solidity').Compiler
var CompilerImport = require('../compiler/compiler-imports')
var tooltip = require('../ui/tooltip')
var QueryParams = require('../../lib/query-params')
var globalRegistry = require('../../global/registry')
const TreeView = require('../ui/TreeView')
Expand Down Expand Up @@ -47,7 +46,7 @@ module.exports = class CompileTab {
self._components.queryParams = new QueryParams()
self._components.compilerImport = new CompilerImport()
self._components.compiler = new Compiler((url, cb) => self.importFileCb(url, cb))

// dependencies
self._deps = {
editor: self._components.registry.get('editor').api,
Expand Down Expand Up @@ -129,7 +128,7 @@ module.exports = class CompileTab {
self._view.contractNames.innerHTML = ''
if (success) {
// TODO consider using compile tab as a proper module instead of just forwarding event
self._deps.pluginManager.receivedDataFrom('sendCompilationResult', 'solidity-compiler', [data.target, source, self.data.selectedVersion, data] )
self._deps.pluginManager.receivedDataFrom('sendCompilationResult', 'solidity-compiler', [data.target, source, self.data.selectedVersion, data])
self._view.contractNames.removeAttribute('disabled')
self._components.compiler.visitContracts(contract => {
self.data.contractsDetails[contract.name] = parseContracts(contract.name, contract.object, self._components.compiler.getSource(contract.file))
Expand Down Expand Up @@ -462,7 +461,7 @@ module.exports = class CompileTab {
selectedVersion = data.releases[data.latestRelease]
if (self._components.queryParams.get().version) selectedVersion = self._components.queryParams.get().version
} catch (e) {
tooltip('Cannot load compiler version list. It might have been blocked by an advertisement blocker. Please try deactivating any of them from this page and reload.')
addTooltip('Cannot load compiler version list. It might have been blocked by an advertisement blocker. Please try deactivating any of them from this page and reload.')
}
} else {
allversions = [{ path: 'builtin', longVersion: 'latest local version' }]
Expand Down Expand Up @@ -501,7 +500,7 @@ module.exports = class CompileTab {
const self = this
self._components.compilerImport.import(url,
(loadingMsg) => {
toolTip(loadingMsg)
addTooltip(loadingMsg)
},
(error, content, cleanUrl, type, url) => {
if (!error) {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/cmdInterpreterAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class CmdInterpreterAPI {
self._components.sourceHighlighter.currentSourceLocation(null)
return
}
var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file,
self._deps.compilersArtefacts['__last'].getSourceCode().sources,
var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file,
self._deps.compilersArtefacts['__last'].getSourceCode().sources,
self._deps.compilersArtefacts['__last'].getAsts())
self._components.sourceHighlighter.currentSourceLocation(lineColumnPos, rawLocation)
}
Expand Down Expand Up @@ -110,8 +110,8 @@ class CmdInterpreterAPI {
self.d.goTo = (row) => {
if (self._deps.editor.current()) {
var breakPoint = new remixLib.code.BreakpointManager(self.d, (sourceLocation) => {
return self._deps.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file,
self._deps.compilersArtefacts['__last'].getSourceCode().sources,
return self._deps.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file,
self._deps.compilersArtefacts['__last'].getSourceCode().sources,
self._deps.compilersArtefacts['__last'].getAsts())
})
breakPoint.event.register('breakpointHit', (sourceLocation, currentStep) => {
Expand Down
3 changes: 1 addition & 2 deletions src/lib/offsetToLineColumnConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ var SourceMappingDecoder = require('remix-lib').SourceMappingDecoder
function offsetToColumnConverter () {
this.lineBreakPositionsByContent = {}
this.sourceMappingDecoder = new SourceMappingDecoder()
var self = this
// we don't listen anymore on compilation result for clearing the cache
}

offsetToColumnConverter.prototype.offsetToLineColumn = function (rawLocation, file, sources, asts) {
if (!this.lineBreakPositionsByContent[file]) {
for (var filename in asts) {
Expand Down

0 comments on commit 0d2287c

Please sign in to comment.