How to use the @theia/editor/lib/browser.Range.create function in @theia/editor

To help you get started, we’ve selected a few @theia/editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse-theia / theia / packages / search-in-workspace / src / browser / quick-search-in-workspace.ts View on Github external
run(mode: QuickOpenMode): boolean {
        if (mode !== QuickOpenMode.OPEN) {
            return false;
        }

        // Search results are 1-based, positions in editors are 0-based.
        const line = this.result.line - 1;
        const character = this.result.character - 1;
        const uri = new URI('file://' + this.result.file);
        const r = Range.create(line, character, line, character + this.result.length);
        open(this.openerService, uri, { selection: r });

        return true;
    }