-
Notifications
You must be signed in to change notification settings - Fork 55
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 compiling and pushing diagnostics #962
Conversation
It looks fine based on your findings above. Besides CPU time, please also keep an eye on memory, and GC. |
import org.eclipse.lsp4j.Position; | ||
import org.eclipse.lsp4j.Range; | ||
|
||
public class GradleUtils { |
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.
About the class name, suggest to move all conversion between LSP item and java element to something like "LSPUtils".
import org.eclipse.lsp4j.Range; | ||
|
||
public class GradleUtils { | ||
public static Range getExpressionLSPRange(SyntaxException exp) { |
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.
Range toRange(SyntaxException exp)
should be simple and enough, if it's callled by LSPUtils.toRange(exp)
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.
LGTM
* 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
Part of #956
One concern here is to reconstruct a new
CompilationUnit
once the text changes. Currently I can't find a proper way to support reuseCompilationUnit
by changing it'sSourceUnit
, and there is no API found. Just test an extreme case on a Gradle file with more than 1000+ lines, writing a Gradle Closure, and the compile time is acceptable.Just search in GitHub and find the following results (Aug.31 2021):
example:
result:
Constant condition:
language:Gradle filename:build.gradle extension:gradle
My test Gradle file has about 1000 lines and the size is about 35KB. So I think the result can cover most case of gradle files.
(This record is just a reference and recorded in my feature branch with semantic highlighting, completion and documentSymbol on, just to show the percentage of compiling)