Closed doom-goober closed 2 years ago
Ok, figured it out. In Brace's index.js add this line:
exports.Range = acequire('ace/range').Range;
Then to use it:
import * as ace from "brace"
let range:ace.Ace.Range = ace.Range.fromPoints(start, end);
editor.selection.setRange(range);
I am using Brace and TypeScript. It was all working swimmingly until I needed to use Range. For the life of me, I can't get Range into my project! It's always undefined even though TypeScript recognizes it during compilation.
Basically, I need the equivalent of: "const Range = ace.require('ace/range').Range" but using imports. ace.require is undefined and I don't know what the alternative is. Thanks!