Skip to content

feat: Support basic tasks and dependencies#1002

Merged
CsCherrYY merged 2 commits intocs-authoring-branchfrom
cs-basic-view
Sep 24, 2021
Merged

feat: Support basic tasks and dependencies#1002
CsCherrYY merged 2 commits intocs-authoring-branchfrom
cs-basic-view

Conversation

@CsCherrYY
Copy link
Collaborator

@CsCherrYY CsCherrYY commented Sep 16, 2021

fix #949

basicview

Will show basic tasks and dependencies, in case of

  • configuring projects
  • fatal error occurs

Add a new workspace command gradle.getDependencies to fetch the literal dependencies from the build.gradle in the project root. When importing huge projects, the literal information of dependencies and tasks will provide more information to the user.

Here we introduce a new view gradleDefaultProjectsView to provide default contents and use a context value gradle:defaultView to control which view (default view or common view) to show.

@CsCherrYY CsCherrYY added the enhancement New feature or request label Sep 16, 2021
@CsCherrYY CsCherrYY added this to the 3.8.0-Sept 2021 milestone Sep 16, 2021
@CsCherrYY CsCherrYY marked this pull request as ready for review September 23, 2021 02:46
},
{
"id": "gradleDefaultProjectsView",
"name": "Default Gradle Projects",
Copy link
Member

Choose a reason for hiding this comment

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

this name is confusing. On first glance, I feel strange about what is "Default Projects".

Copy link
Member

Choose a reason for hiding this comment

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

suggest to use the same name, otherwise you will see flickering between "Gradle Projects" and "Default Gradle Projects" when you editing build.gradle

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree. Should we use something to indicate the difference between the two views (e.g. description in the project node) or just keep the same view name?

Copy link
Member

Choose a reason for hiding this comment

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

Do you think it's necessary to let users be aware of two views? I don't think so. Implementing two views is a trick, they actually serve the same purpose and should be regarded as a single view.


export class DefaultProjectProvider {
// task name, task group, task description
private static defaultTaskDefinitions: [string, string, string][] = [
Copy link
Member

Choose a reason for hiding this comment

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

string[][] is hard to maintain, because statement like taskDefinition[1] is hard to understand.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here we can use an interface and an array to refactor, making it more readable.

} else if (element instanceof GroupTreeItem) {
return element.tasks;
}
return [];
Copy link
Member

Choose a reason for hiding this comment

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

Is there any difference between [] and undefined ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No difference for the appearance. Returning both of them will just show no children. Considering the other implementation of TreeDataProvider in this repository, it's better to keep the return type as vscode.TreeItem[]?

Copy link
Member

Choose a reason for hiding this comment

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

I just have some impression that it has something to do with collapsedState. Never mind.

@CsCherrYY CsCherrYY merged commit 0aeb3bd into cs-authoring-branch Sep 24, 2021
@CsCherrYY CsCherrYY deleted the cs-basic-view branch September 24, 2021 01:27
CsCherrYY added a commit that referenced this pull request Sep 26, 2021
* feat: Initialize Language Server (#959)

* feat: Support compiling and pushing diagnostics (#962)

* feat: Support basic groovy syntax highlighting (#960)

* feat: Support semantic highlighting (#967)

* feat: Support document outline (#969)

* feat: Support auto completion in dependencies closure (#970)

* feat: Support Basic Auto Completion (#971)

* fix: Add null check for visitors (#974)

* feat: Show symbol detail for method calls (#973)

* chore: Prepare for 3.8.0 (#978)

* fix: Use padding to correct version order (#986)

* fix: Dependency completion doesn't work when multiple dependencies closures exist (#984)

* fix: Correct version completion kind (#985)

* fix: Handle multiple content changes (#992)

* feat: Support completion for settings.gradle (#988)

* fix: Offer completion results from supertypes (#987)

* feat: Provide dependencies content in outline (#998)

* feat: Support basic java plugin aware (#989)

* feat: Support basic tasks and dependencies (#1002)

* chore: Add thirdpartynotice

* chore: Fix ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants