feat: show task description from deno.json in tasks view and command palette#1304
Conversation
Mrashes
left a comment
There was a problem hiding this comment.
looks good, thanks for making the issue and tackling it!
| this.command = commandList[defaultCommand]; | ||
| this.iconPath = new ThemeIcon("wrench"); | ||
|
|
||
| if (this.task.definition.command) { |
There was a problem hiding this comment.
I removed this if check because we're no longer using this.task.definition.command.
Even before this change, the "task" string was always being passed, so the if condition was always true anyway:
vscode_deno/client/src/tasks.ts
Line 69 in 880dd48
| name: string, | ||
| command: string | undefined, | ||
| sourceUri?: vscode.Uri, | ||
| description: string = "", |
There was a problem hiding this comment.
is description able to be null? TaskRequestResponse has it string or null, this has it as only string. Want to make sure we are consistent.
There was a problem hiding this comment.
The buildDenoConfigTask function is also used in other places, such as DenoTaskProvider.resolveTask (
vscode_deno/client/src/tasks.ts
Line 171 in 880dd48
Since I added description as a new parameter after the optional sourceUri, it also needs to be an optional parameter. Otherwise, it would cause a TypeScript error due to the ordering of optional and required parameters.
Although the current usage of buildDenoConfigTask is not well unified, I felt it wasn't necessary to refactor that at this time. So I kept description as an optional parameter with a default value of "".
Ref: #1303