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

Improve JDTUtils.resolveCompilationUnit #3313

Closed
snjeza opened this issue Oct 31, 2024 · 2 comments · Fixed by #3314
Closed

Improve JDTUtils.resolveCompilationUnit #3313

snjeza opened this issue Oct 31, 2024 · 2 comments · Fixed by #3314
Assignees

Comments

@snjeza
Copy link
Contributor

snjeza commented Oct 31, 2024

Related to eclipse-jdtls/eclipse-jdt-core-incubator#755

Steps to reproduce:

  • start VS Code with "java.jdt.ls.javac.enabled": "on",
  • import the weblaf project
  • wait for the project to be fully imported
  • open WStyledLabelUI.java
  • call hover and wait for it to finish
  • call hover again

You will notice the action always takes a few seconds.
The issue happens because JDTUtils.resolveCompilationUnit always creates a new compilation unit.

@rgrunber
Copy link
Contributor

rgrunber commented Oct 31, 2024

Does it create a new compilation unit in the ecj case, or only for javac ? FWIW it makes perfect sense to recover the compilation unit from the working copies. Those are many of the calls, given that most cases are for opened files.

@snjeza
Copy link
Contributor Author

snjeza commented Oct 31, 2024

Does it create a new compilation unit in the ecj case, or only for javac

No, it doesn't. It will improve ecj too. It is only easier to reproduce the issue in a large project with javac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants