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

Revalidate open files in project when classpath updates. #3159

Conversation

ethan-vanderheijden
Copy link
Contributor

Fixes #3155

It now re-validates all open files in a project when the project's classpath is updated. This only happens when autobuild is turned off (I assume that when autobuild is on, projects are automatically rebuilt when the classpath changes and files are re-validated in the process).

I implemented this through ClasspathUpdateHandler and DiagnosticsHandler which is probably not a good idea (e.g. does this code belong in ClasspathUpdateHandler? should we re-validate files through DocumentLifeCycleHandler to take advantage of debouncing?). Let me know if I should do anything differently.

@eclipse-ls-bot
Copy link

Can one of the admins verify this patch?

@rgrunber rgrunber self-requested a review May 28, 2024 03:02
@rgrunber rgrunber added this to the End June 2024 milestone May 30, 2024
Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

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

I tried this change and it seems to be working well. I think I found a way (comment below) to make sure we go through the document life cycle, which should use the debouncing mechanism. Let me know.

Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

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

Change works well for me. I even tried with java.edit.validateAllOpenBuffersOnChanges on/off. They control different strategies of surfacing errors (one is through getting the working copies, the other is through client-side hooks).

I think this looks good to merge. Just one minor thing to remove.

@rgrunber rgrunber merged commit bb26c98 into eclipse-jdtls:master Jun 7, 2024
6 checks passed
@rgrunber rgrunber removed this from the End June 2024 milestone Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't revalidate project files after classpath changes if autobuild is off.
3 participants