-
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 semantic highlighting #967
Conversation
25ea215
to
083fd60
Compare
@@ -102,6 +109,8 @@ private void compile(URI uri, GradleCompilationUnit unit) { | |||
Set<PublishDiagnosticsParams> diagnostics = new HashSet<>(); | |||
try { | |||
unit.compile(Phases.CANONICALIZATION); | |||
// If fatal error occurs and no AST generated, the visitCompilationUnit() will be ignored. | |||
this.visitor.visitCompilationUnit(uri, unit); |
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.
this ASTVisitor is to calculate Semantic Tokens. but compile(uri, unit)
is shared among other tasks. So, will there be unnecessary calculation here e.g. when processing 'textdocument/completion` requests?
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.
We have stored the results in the ASTVisitor and get them via this.visitor.getXXX()
. So if we support completion, we'll add some operations in the ASTVisitor and storage the completion related results. The approach is that we don't have to visit the AST more than once to the all the results. (for semantic highlighting, document symbol and completion)
If we separate the visitor for each usage, we might visit the AST more than once.
|
||
private String genericName; | ||
// See https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html | ||
private static List<String> defaultLibrary = List.of("afterEvaluate", "allprojects", "ant", "apply", "artifacts", |
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.
is it necessary to assign individual modifier for every closure type? How do you assign textmate scopes/styles in downstream themes then?
* 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. Please note that basic syntax highlighting is in #960.