| Conditions | 2 |
| Total Lines | 11 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import * as vscode from 'vscode'; |
||
| 9 | |||
| 10 | export function commandDecorator(command: CommandHandler, messages: CommandMessages):CommandHandler { |
||
| 11 | return (...args: any[]) => { |
||
| 12 | const { SUCCESS_MESSAGE, ERROR_MESSAGE } = messages; |
||
| 13 | |||
| 14 | try { |
||
| 15 | command(...args); |
||
| 16 | vscode.window.showInformationMessage(SUCCESS_MESSAGE); |
||
| 17 | } catch (error) { |
||
| 18 | console.error(error); |
||
| 19 | vscode.window.showErrorMessage(ERROR_MESSAGE); |
||
| 20 | } |
||
| 23 |