-
Notifications
You must be signed in to change notification settings - Fork 57
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 Auto Completion #971
Conversation
c793632
to
6d2ca14
Compare
abae73d
to
85eefed
Compare
in the screenshot above, when selecting |
It's a bug. Just try in IntelliJ and find it's behavior:
I'd like to change to this in the next commit. |
@@ -16,6 +16,7 @@ dependencies { | |||
implementation "org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.12.0" | |||
implementation "org.codehaus.groovy:groovy-eclipse-batch:3.0.8-01" | |||
implementation "com.google.code.gson:gson:2.8.7" | |||
implementation "org.apache.bcel:bcel:6.5.0" |
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.
if it's shipped together, you should update thirdpartynotice
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.
should we update the thirdpartynotice
for other dependencies?
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.
Yes, we'd better do that.
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.
track in #976
@@ -42,4 +53,14 @@ public static String getStringBeforePosition(String text, Range range, Position | |||
} | |||
return text.substring(0, position.getCharacter() - start.getCharacter()); | |||
} | |||
|
|||
public static void applySetting(GradleServices services, Object settings) { |
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.
applySetting
anything to do with LSP?
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 setting values are converted from LSP Json objects. Maybe something like GradleServivesUtils
is a better place for this method?
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.
to me, LSPUtils should host utilities like converting between LSP objects and other data structures.
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.
can it be a public member of class GradleServices
?
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.
can it be a public member of class
GradleServices
?
Sure.
this.applySetting(this, settings); | ||
} | ||
|
||
public void applySetting(GradleServices services, Object settings) { |
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.
why do you need to pass a GradleService
? Can it be public void applySetting(Object settings)
?
* 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
Parts of #956
This PR try to get local gradle library file via the current vscode-java settings, and parse the gradle library file to get the content.
For method calls, we'll calculate call the method calls from the root to the inner calls, and use "org.gradle.api.Project" to match them one by one, for the final calls, we get the related Gradle Library and offer the completion results.