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

Reload the cached classfile sources when new source attachment is updated for them #3207

Merged

Conversation

testforstephen
Copy link
Collaborator

@testforstephen testforstephen commented Jul 18, 2023

This requires jdt.ls PR eclipse-jdtls/eclipse.jdt.ls#2764.

What this PR does:

  • Respond to SourceInvalidatedEvent notification. If the event is triggered by user operation such as "Attach Source", then refresh the open editors for new source directly. If it's triggered by auto downloading maven source, then ask user whether to reload the new source. This refresh behavior is controlled by a setting java.editor.reloadChangedSources. Defaults to ask, you can change it to auto for refreshing automatically.

  • Expose the SourceInvalidatedEvent as an extension API onDidSourceInvalidate. This will let other source consumers (e.g. Debugger) to refresh their cache as well. The debugger should update the line numbers of the relevant stack frames when the new source jar is available.

  • Ask to refresh open editors for new maven source

download_source_switch.mp4
  • Auto refresh open editors for manually attached source
manual_attach_source.mp4

…ated for them

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Copy link
Collaborator

@jdneo jdneo left a comment

Choose a reason for hiding this comment

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

LGTM

@testforstephen testforstephen merged commit a60b5e4 into redhat-developer:master Jul 21, 2023
2 checks passed
@testforstephen testforstephen deleted the jinbo_reloadClassSource branch July 21, 2023 06:07
@testforstephen testforstephen added this to the End July 2023 milestone Jul 21, 2023
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.

None yet

2 participants