How to use the @theia/editor/lib/browser.Position.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 / debug / src / browser / model / debug-stack-frame.tsx View on Github external
async open(options: WidgetOpenerOptions = {
        mode: 'reveal'
    }): Promise {
        if (!this.source) {
            return undefined;
        }
        const { line, column, endLine, endColumn } = this.raw;
        const selection: RecursivePartial = {
            start: Position.create(line - 1, column - 1)
        };
        if (typeof endLine === 'number') {
            selection.end = {
                line: endLine - 1,
                character: typeof endColumn === 'number' ? endColumn - 1 : undefined
            };
        }
        this.source.open({
            ...options,
            selection
        });
    }
github eclipse-theia / theia / packages / debug / src / browser / debug-utils.ts View on Github external
private toEditorOpenerOption(frame: DebugProtocol.StackFrame): EditorOpenerOptions {
        return {
            selection: { start: Position.create(frame.line - 1, frame.column - 1) }
        };
    }
}