@inheritdoc
()
| 787 | |
| 788 | /** @inheritdoc */ |
| 789 | public async scopes(): Promise<Dap.ScopesResult> { |
| 790 | const v = this.source.sourceMap.value.settledValue; |
| 791 | const callFrameId = this.root.callFrameId(); |
| 792 | if (!v || !callFrameId) { |
| 793 | return EMPTY_SCOPES; |
| 794 | } |
| 795 | |
| 796 | const variables = await v.getVariablesInScope?.(callFrameId, this.wasmPosition); |
| 797 | if (!variables) { |
| 798 | return EMPTY_SCOPES; |
| 799 | } |
| 800 | |
| 801 | const paused = this.thread.pausedVariables(); |
| 802 | if (!paused) { |
| 803 | return EMPTY_SCOPES; |
| 804 | } |
| 805 | |
| 806 | const scopeRef: IScopeRef = { |
| 807 | stackFrame: this.root, |
| 808 | callFrameId, |
| 809 | scopeNumber: 0, // this is only used for setting variables, which wasm doesn't support |
| 810 | }; |
| 811 | |
| 812 | return { |
| 813 | scopes: await Promise.all( |
| 814 | [...groupBy(variables, v => v.scope)].map(([key, vars]) => |
| 815 | paused |
| 816 | .createWasmScope(key as WasmScope, vars, scopeRef) |
| 817 | .toDap(PreviewContextType.PropertyValue) |
| 818 | .then(v => ({ |
| 819 | name: v.name, |
| 820 | variablesReference: v.variablesReference, |
| 821 | expensive: key !== WasmScope.Local, |
| 822 | })) |
| 823 | ), |
| 824 | ), |
| 825 | }; |
| 826 | } |
| 827 | } |
nothing calls this directly
no test coverage detected