Pycharm doesn't understand project is in a symlink
PyCharm doesn't seem to understand that it is inside a symlink when opening files from a stacktrace in the console or stopping at breakpoints. I assume this is due to python adding the target of the symlink to the pythonpath in front of the symlink. Is there a way to tell PyCharm it is in a symlink so when it opens a file it knows to open the symlink version instead of the real version.
For example, I have a mounted filesystem in /Volumes/CODE with a directory /dev (/Volumes/CODE/dev) I have a symlink of /dev -> /Volumes/CODE/dev. If I run the project from /dev/<project>, python apparently adds /Volumes/CODE/dev/<project> to the pythonpath in front of /dev/project so it ends up actually running /Volumes/CODE/dev/<project>/... for all of it's modules. This causes stacktraces in the console to display /Volumes/CODE/dev/<project>/... and breakpoints to open the /Volumes/CODE/dev/<project>/... file when stopping. This causes confusion because I end up with two instances of effectively the same file open, one in the project and one out of the project. I am unable to edit the one out of the file easily without it warning me I am doing so and changes are not immediately apparent in the file inside the project when doing so.
请先登录再写评论。
Hi! It looks like your problem is already described here: https://youtrack.jetbrains.com/issue/PY-20295. Please, vote for the issue and follow it in our tracker.