Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
});
}
private toEditorOpenerOption(frame: DebugProtocol.StackFrame): EditorOpenerOptions {
return {
selection: { start: Position.create(frame.line - 1, frame.column - 1) }
};
}
}