Skip to content
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

feat: Support basic java plugin aware #989

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

CsCherrYY
Copy link
Collaborator

@CsCherrYY CsCherrYY commented Sep 7, 2021

related to #982

In CompletionVisitor, supports two kinds of plugin declaration:

plugins {
  id: "java" (optional: version: "")
}

and

apply plugin: "java"

and collect the applied plugins information.

In GradleLibraryResolver, get available java related configurations from public fields in org.gradle.api.plugins.JavaPlugin

In CompletionHandler, if current closure is dependencies and java related plugin is applied, we offer java configurations as completion items too.

plugin

@CsCherrYY CsCherrYY added the enhancement New feature or request label Sep 7, 2021
@CsCherrYY CsCherrYY added this to the 3.8.0 milestone Sep 7, 2021
private String gradleHome;
private String gradleVersion;
private boolean gradleWrapperEnabled;
private String gradleUserHome;
private Path workspacePath;

public GradleLibraryResolver() {
this.javaPlugins.addAll(Arrays.asList("java", "application", "groovy", "java-library", "war"));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The rest four plugins apply java plugin as well.

return;
}
for (Field field : javaPluginClass.getFields()) {
if (field.getName().endsWith("CONFIGURATION_NAME")) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@CsCherrYY CsCherrYY merged commit 4cbfeac into cs-authoring-branch Sep 23, 2021
@CsCherrYY CsCherrYY deleted the cs-issue982-plugin branch September 23, 2021 13:45
CsCherrYY added a commit that referenced this pull request Sep 24, 2021
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