Skip to content

feat: show task description from deno.json in tasks view and command palette#1304

Merged
nayeemrmn merged 1 commit intodenoland:mainfrom
narumincho:task-description
May 29, 2025
Merged

feat: show task description from deno.json in tasks view and command palette#1304
nayeemrmn merged 1 commit intodenoland:mainfrom
narumincho:task-description

Conversation

@narumincho
Copy link
Contributor

Ref: #1303

@CLAassistant
Copy link

CLAassistant commented May 17, 2025

CLA assistant check
All committers have signed the CLA.

@narumincho narumincho changed the title feat: show task description from deno.json in tasks view and command … feat: show task description from deno.json in tasks view and command palette May 17, 2025
Copy link

@Mrashes Mrashes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks for making the issue and tackling it!

this.command = commandList[defaultCommand];
this.iconPath = new ThemeIcon("wrench");

if (this.task.definition.command) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this if check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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:

command: "task",

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the explainer

name: string,
command: string | undefined,
sourceUri?: vscode.Uri,
description: string = "",
Copy link

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.

Copy link
Contributor Author

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 (

return buildDenoConfigTask(
), where sourceUri is not provided.

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 "".

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it - thanks!

Copy link
Collaborator

@nayeemrmn nayeemrmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nayeemrmn nayeemrmn merged commit 880dd48 into denoland:main May 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants