-
Notifications
You must be signed in to change notification settings - Fork 158
feat: show task description from deno.json in tasks view and command palette #1304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -98,10 +98,8 @@ class DenoTask extends TreeItem { | |||
| this.command = commandList[defaultCommand]; | ||||
| this.iconPath = new ThemeIcon("wrench"); | ||||
|
|
||||
| if (this.task.definition.command) { | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove this if check?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Appreciate the explainer |
||||
| this.tooltip = this.task.definition.command; | ||||
| this.description = this.task.definition.command; | ||||
| } | ||||
| this.tooltip = this.task.detail; | ||||
| this.description = this.task.detail; | ||||
| } | ||||
|
|
||||
| getFolder(): WorkspaceFolder { | ||||
|
|
@@ -153,6 +151,7 @@ class DenoTaskProvider implements TaskProvider { | |||
| configTask.name, | ||||
| configTask.command ?? configTask.detail, | ||||
| Uri.parse(configTask.sourceUri), | ||||
| configTask.description ?? "", | ||||
| ); | ||||
| tasks.push(task); | ||||
| } | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 "".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it - thanks!