(target: IOutputChannel, propKey: keyof IOutputChannel)
| 18 | disposables.push(jupyterServerOutputChannel); |
| 19 | const handler: ProxyHandler<IOutputChannel> = { |
| 20 | get(target: IOutputChannel, propKey: keyof IOutputChannel) { |
| 21 | const method = target[propKey]; |
| 22 | if (typeof method === 'function') { |
| 23 | if (propKey === 'append') { |
| 24 | return (...args: Parameters<IOutputChannel['append']>) => { |
| 25 | jupyterServerOutputChannel.append(...args); |
| 26 | formatMessageAndLog(...args); |
| 27 | }; |
| 28 | } |
| 29 | if (propKey === 'appendLine') { |
| 30 | return (...args: Parameters<IOutputChannel['appendLine']>) => { |
| 31 | jupyterServerOutputChannel.appendLine(...args); |
| 32 | formatMessageAndLog(...args); |
| 33 | }; |
| 34 | } |
| 35 | } |
| 36 | return method; |
| 37 | } |
| 38 | }; |
| 39 | return new Proxy(jupyterServerOutputChannel, handler); |
| 40 | } |
nothing calls this directly
no test coverage detected