(
rootVariable: Dap.Variable,
options: ILogOptions = {},
baseIndent: string = '',
)
| 78 | } |
| 79 | |
| 80 | public logVariable( |
| 81 | rootVariable: Dap.Variable, |
| 82 | options: ILogOptions = {}, |
| 83 | baseIndent: string = '', |
| 84 | ): Promise<void> { |
| 85 | return walkVariables(this._dap, rootVariable, (variable, depth) => { |
| 86 | const name = variable.name ? `${variable.name}: ` : ''; |
| 87 | let value = variable.value || ''; |
| 88 | if (value.endsWith('\n')) value = value.substring(0, value.length - 1); |
| 89 | const type = variable.type ? `type=${variable.type}` : ''; |
| 90 | const namedCount = variable.namedVariables ? ` named=${variable.namedVariables}` : ''; |
| 91 | const indexedCount = variable.indexedVariables ? ` indexed=${variable.indexedVariables}` : ''; |
| 92 | const indent = baseIndent + ' '.repeat(depth); |
| 93 | |
| 94 | const expanded = variable.variablesReference ? '> ' : ''; |
| 95 | let suffix = options.logInternalInfo ? `${type}${namedCount}${indexedCount}` : ''; |
| 96 | if (suffix) suffix = ' // ' + suffix; |
| 97 | let line = `${expanded}${name}${value}`; |
| 98 | if (line) { |
| 99 | if (line.includes('\n')) line = '\n' + line; |
| 100 | this.logAsConsole(`${indent}${line}${suffix}`); |
| 101 | } |
| 102 | |
| 103 | return depth < (options.depth ?? 1); |
| 104 | }); |
| 105 | } |
| 106 | |
| 107 | async logOutput(params: Dap.OutputEventParams, options?: ILogOptions) { |
| 108 | if (params.group) { |
no test coverage detected