;
data: CommonDataTypes.AstData;
+ nodeInfoToRange: (info: NodeInfo) => monaco.IRange;
}> {
render() {
const model = this.props.model;
@@ -63,6 +90,7 @@ export class AstTree extends React.Component<{
;
+ nodeInfoToRange: (info: NodeInfo) => monaco.IRange;
}> {
@observable private editor: monaco.editor.IStandaloneCodeEditor | undefined;
@@ -112,7 +131,7 @@ export class MonacoEditor extends React.Component<{
if (this.editor && this.model) {
const editorModel = this.model;
const ranges = this.props.model.marked.map(s =>
- nodeInfoToRange(s.data, editorModel)
+ this.props.nodeInfoToRange(s.data)
);
this.markedDecorations = this.editor.deltaDecorations(
this.markedDecorations,
@@ -138,7 +157,7 @@ export class MonacoEditor extends React.Component<{
if (this.editor && this.model) {
const selected = this.props.model.selected;
if (selected) {
- const range = nodeInfoToRange(selected.data, this.model);
+ const range = this.props.nodeInfoToRange(selected.data);
this.selectedDecorations = this.editor.deltaDecorations(
this.selectedDecorations,
[