Update SourceHighlighter to ES6

pull/1/head
Grandschtroumpf 6 years ago
parent b5d9dc3c18
commit 34a297fc7f
  1. 27
      src/app/editor/sourceHighlighter.js

@ -1,20 +1,19 @@
'use strict'
var csjs = require('csjs-inject')
var globlalRegistry = require('../../global/registry')
var styleGuide = require('../ui/styles-guide/theme-chooser')
var styles = styleGuide.chooser()
const csjs = require('csjs-inject')
const globlalRegistry = require('../../global/registry')
const styleGuide = require('../ui/styles-guide/theme-chooser')
const styles = styleGuide.chooser()
class SourceHighlighter {
constructor (localRegistry) {
const self = this
self._components = {}
self._components.registry = localRegistry || globlalRegistry
this._components = {}
this._components.registry = localRegistry || globlalRegistry
// dependencies
self._deps = {
editor: self._components.registry.get('editor').api,
config: self._components.registry.get('config').api,
fileManager: self._components.registry.get('filemanager').api,
compilerArtefacts: self._components.registry.get('compilersartefacts').api
this._deps = {
editor: this._components.registry.get('editor').api,
config: this._components.registry.get('config').api,
fileManager: this._components.registry.get('filemanager').api,
compilerArtefacts: this._components.registry.get('compilersartefacts').api
}
this.statementMarker = null
this.fullLineMarker = null
@ -26,7 +25,7 @@ class SourceHighlighter {
if (this.fullLineMarker) this._deps.editor.removeMarker(this.fullLineMarker, this.source)
let lastCompilationResult = this._deps.compilerArtefacts['__last']
if (location && location.file !== undefined && lastCompilationResult) {
var path = lastCompilationResult.getSourceName(location.file)
const path = lastCompilationResult.getSourceName(location.file)
if (path) {
this.currentSourceLocationFromfileName(lineColumnPos, path)
}
@ -45,7 +44,7 @@ class SourceHighlighter {
this._deps.fileManager.switchFile(this.source)
}
var css = csjs`
const css = csjs`
.highlightcode {
position:absolute;
z-index:20;

Loading…
Cancel
Save