| 695 | const EMPTY_SCOPES: Dap.ScopesResult = { scopes: [] }; |
| 696 | |
| 697 | export class InlinedFrame implements IStackFrameElement { |
| 698 | /** @inheritdoc */ |
| 699 | public readonly root: StackFrame; |
| 700 | |
| 701 | /** @inheritdoc */ |
| 702 | public readonly frameId = frameIdCounter(); |
| 703 | |
| 704 | /** @inheritdoc */ |
| 705 | public readonly uiLocation: () => Promise<IPreferredUiLocation>; |
| 706 | |
| 707 | public readonly inlineFrameIndex: number; |
| 708 | |
| 709 | private readonly wasmPosition: Base0Position; |
| 710 | private readonly name: string; |
| 711 | private readonly thread: Thread; |
| 712 | private readonly source: ISourceWithMap<IWasmLocationProvider>; |
| 713 | |
| 714 | constructor(opts: { |
| 715 | thread: Thread; |
| 716 | /** Inline frame index in the function info */ |
| 717 | inlineFrameIndex: number; |
| 718 | /** Display name of the call frame */ |
| 719 | name: string; |
| 720 | /** Original WASM source */ |
| 721 | source: ISourceWithMap<IWasmLocationProvider>; |
| 722 | /** Original stack frame this was derived from */ |
| 723 | root: StackFrame; |
| 724 | }) { |
| 725 | this.name = opts.name; |
| 726 | this.root = opts.root; |
| 727 | this.thread = opts.thread; |
| 728 | this.source = opts.source; |
| 729 | this.inlineFrameIndex = opts.inlineFrameIndex; |
| 730 | this.wasmPosition = new Base0Position( |
| 731 | this.inlineFrameIndex, |
| 732 | this.root.rawPosition.base0.columnNumber, |
| 733 | ); |
| 734 | this.uiLocation = once(() => |
| 735 | opts.thread._sourceContainer.preferredUiLocation({ |
| 736 | columnNumber: opts.root.rawPosition.base1.columnNumber, |
| 737 | lineNumber: opts.inlineFrameIndex + 1, |
| 738 | source: opts.source, |
| 739 | }) |
| 740 | ); |
| 741 | } |
| 742 | |
| 743 | /** @inheritdoc */ |
| 744 | public async formatAsNative(): Promise<string> { |
| 745 | const { columnNumber, lineNumber, source } = await this.uiLocation(); |
| 746 | return ` at ${this.name} (${source.url}:${lineNumber}:${columnNumber})`; |
| 747 | } |
| 748 | |
| 749 | /** @inheritdoc */ |
| 750 | public async format(): Promise<string> { |
| 751 | const { columnNumber, lineNumber, source } = await this.uiLocation(); |
| 752 | const prettyName = (await source.prettyName()) || '<unknown>'; |
| 753 | return `${this.name} @ ${prettyName}:${lineNumber}:${columnNumber}`; |
| 754 | } |
nothing calls this directly
no outgoing calls
no test coverage detected