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

Add hot code reload #1419

Merged
merged 5 commits into from Feb 22, 2024
Merged

Add hot code reload #1419

merged 5 commits into from Feb 22, 2024

Conversation

iusildra
Copy link
Contributor

@iusildra iusildra commented Aug 14, 2023

Address this feature request, but for now, it should only works with sbt, I'll look to make it works with bloop too later. I adapted the implementation from vscode-java-debug to work with metals

The implementation on the debugger side is in this pr (not published yet)

There are a few inconsistencies left in my implementation on the VS Code extension:

  • If the setting scalaHotReloadOn is not ticked, the button still appear (we need to tick and untick to make it disappear)
  • If HCR is not supported by the debugger, it show a warning message "no changed classes found", which is not relevant

@iusildra iusildra force-pushed the add-hot-code-reload branch 2 times, most recently from 63be625 to 595334f Compare August 25, 2023 11:52
@iusildra iusildra marked this pull request as ready for review August 25, 2023 12:12
@iusildra
Copy link
Contributor Author

It will need both upcoming versions of the debugger (for the implementation) and metals (for the sync with compilation) to be fully functional

Also, before merging I'll need to change the metals server's version before which HCR would not work to give proper information

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Thanks for the great work! It will be amazing for the users.

Let's wait until we update scala debug adapter properly in Bloop and sbt

packages/metals-vscode/src/hotCodeReplace.ts Outdated Show resolved Hide resolved
.vscode/settings.json Outdated Show resolved Hide resolved
packages/metals-vscode/package.json Outdated Show resolved Hide resolved
packages/metals-vscode/package.json Outdated Show resolved Hide resolved
packages/metals-vscode/package.json Outdated Show resolved Hide resolved
packages/metals-vscode/src/hotCodeReplace.ts Outdated Show resolved Hide resolved
packages/metals-vscode/src/hotCodeReplace.ts Outdated Show resolved Hide resolved
cleaning up

allow hcr from specific metals version

auto save files before hcr
@adpi2 adpi2 force-pushed the add-hot-code-reload branch 4 times, most recently from ae40b85 to 9885716 Compare February 8, 2024 13:06
@adpi2
Copy link
Member

adpi2 commented Feb 19, 2024

@tgodzik this PR is ready to be reviewed and merged.

It adds the lightning button in the debug tool bar to trigger a hot code reload.

@adpi2 adpi2 requested a review from tgodzik February 19, 2024 14:24
@adpi2 adpi2 requested a review from tgodzik February 22, 2024 10:43
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

LGTM!

@tgodzik tgodzik merged commit 4dbfd24 into scalameta:main Feb 22, 2024
10 checks passed
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

3 participants