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 is not triggered when switching Git branches #49

Open
jacobm-tech opened this issue Oct 10, 2022 · 1 comment
Open

Reload is not triggered when switching Git branches #49

jacobm-tech opened this issue Oct 10, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@jacobm-tech
Copy link

In the new version of Reloadium/PyCharm (fixed 0.9.3 with a "reload file" button), reloads are not triggered on

  1. External changes to files (editing the file in an editor outside of PyCharm and saving it): PyCharm picks up the changes, but Reloadium is not triggered until the "reload file" button is pressed.
    2. Any Git operations (stashing/unstashing, switching branches, etc.).

Now 1. is not a big deal, since I don't edit files outside of PyCharm while developing with PyCharm. However, 2. is a problem, since my major use case for Reloadium was making a bunch of cosmetic changes in the program and switching between a version with them and without them while it's running. And I think this used to work before.

The workaround of going to every changed file and clicking "reload file" is not only inconvenient, but I think it may even be incorrect since you would leave the program in an invalid state, as some of the changes are dependent on one another.

My suggestion would either be to detect Git operations within PyCharm itself (such as switching a branch) and reloading all changed files, or have a button which checks for changes in all tracked files and reloads them together if it finds changes. In other words, "reload all changed files" button instead of a "reload file" button.

To Reproduce
Steps to reproduce the behavior:
Switch Git branches within PyCharm while the program is running with Reloadium. No reload is triggered. Going to individual changed files and pressing the "reload file" button does trigger reloads.

Expected behavior
All changes from the new branch should be loaded in a single batch, so as to maintain consistent code state.

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 11
  • Reloadium package version: 0.9.3 with fix for previous issues
  • PyCharm plugin version: 0.8.6 with fix
  • Editor: PyCharm
  • Run mode: Run and Debug
@dkrystki
Copy link
Contributor

Reloading multiple files is in general unsafe operation currently.
If there are relations between files (class definition in one file and use in other) it will break when reloading is not in the proper order.
It is possible to reload this safely but as of now I have limited bandwidth to work on this.

Adding a button "Reload all" with a warning prompt might be a good compromise at this point though.
I'll keep this issue open until then.

@dkrystki dkrystki added the enhancement New feature or request label Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants