Eclipse pydev: automatically save file when program starts

It used to be that when I made changes to my .py file in Eclipse, the changes were automatically saved when I ran the program in debug mode. I liked this because it meant that what was debugging was the same as what I was looking at. Now this is no longer the case, which means that it actually launches the old version, if I do not save the file manually first. The first time I ran the program, Eclipse asked me if I always want the changes to be saved when the program starts, and I said yes. I do not know why this is no longer working or how to return it.

This seems to have happened after I started using Mercurial TortoiseHg with BitBucket. As part of this, I moved some files around, but everything comes back and is named the same as before.

Of course, I can just make changes, save, run, but it’s better not to remember the extra save step.

Edit: This is actually a big problem. It also changes my breakpoints. In normal editing mode, I 1) set a breakpoint and save. 2) Add a new line above the breakpoint. Everything looks good. 3) Save. Now the first breakpoint shifts the position.

+4
source share
2 answers

From your description, it seems that you always open the file as an external file, not a file in your workspace (the fact that breakpoints are not updated is the main key here).

You can check if this comes from the name shown in Eclipse (if this is the full path to the file system and not the relative path given your workspace location, this is what is likely to happen).

How do you open the file you are using? Do you open it from the PyDev package explorer or drag it from the file system? (It would also be interesting to know which versions of eclipse / pydev / tortoise you are using)

+3
source

Look at your settings -> Run / Debug -> Run, you should probably set "Never" to "Save necessary dirty editors" before starting.

+1
source

Source: https://habr.com/ru/post/1387333/


All Articles