use contextuallistener

pull/1/head
yann300 7 years ago
parent 281bee2319
commit bf278f68d1
  1. 7
      assets/css/browser-solidity.css
  2. 20
      src/app.js

@ -290,6 +290,13 @@ input[type="file"] {
display: none;
}
.highlightcall {
position:absolute;
z-index:20;
background-color: lightgrey;
opacity: 0.5
}
.highlightcode {
position:absolute;
z-index:20;

@ -34,6 +34,7 @@ var TxLogger = require('./app/execution/txLogger')
var EventsDecoder = require('./app/execution/eventsDecoder')
var handleImports = require('./app/compiler/compiler-imports')
var FileManager = require('./app/files/fileManager')
var ContextualListener = require('./app/editor/contextualListener')
var styleGuide = remix.ui.styleGuide
var styles = styleGuide()
@ -385,6 +386,25 @@ function run () {
})
var offsetToLineColumnConverter = new OffsetToLineColumnConverter(compiler.event)
// ---------------- ContextualListener -----------------------
this._components.contextualListener = new ContextualListener({
getCursorPosition: () => {
return this._components.editor.getCursorPosition()
},
getCompilationResult: () => {
return compiler.lastCompilationResult
},
warnFoundCall: (position) => {
position = offsetToLineColumnConverter.offsetToLineColumn(position, position.file, compiler.lastCompilationResult)
return editor.addMarker(position, config.get('currentFile'), 'highlightcall')
},
stopFoundCall: (event) => {
editor.removeMarker(event.eventId, event.fileTarget)
}
}, {
compiler: compiler.event
})
// ----------------- Renderer -----------------
var rendererAPI = {
error: (file, error) => {

Loading…
Cancel
Save