I saw a single post about this before, but it was a long time ago and had no responses.
I'm just going to explain what I'm doing. It's not a rare circumstance considering how Python is very commonly used for plugins.
I develop an addon for Kodi. Due to the nature of Kodi's virtual python environment (python called from C++ with black magic in there somewhere), it's basically impossible to debug "locally". I set up remote debugging and it works...mostly. The issue is that it always opens %appdata%/Kodi/addons/../somefile.py instead of the somefile.py that I have open in front of me. I have tried path mappings, and I don't want to mess with permissions just to make it obey a setting that should ALWAYS be obeyed if populated. It'll more than likely cause more problems than solve.
I could throw Kodi on another machine and actually remote debug, but...why? That serves no benefit.
"If I can access the files that are actually running why would I want to use the workspace ones?" is the question that I'm expecting to get. BECAUSE I'M DEBUGGING. The files are up to date. They haven't changed, but I can't hit any breakpoints that I place, because it decides that files that are not in my workspace are better.
You know what Rider does better? This. Debug a file, it says hey you have that file. If the source doesn't match, then it tells me, which can solve some problems by itself, as I'll know that the build isn't updating. The only reason it shows me the remote (decompiled) source is because I don't have a copy. This is how it should work. I already have everything open. Don't open another copy elsewhere on my computer if I am already looking at it. Use the breakpoints that I'm looking at. When I say step through, use my workspace files.
If you need a good reason as to why path mappings should ALWAYS be obeyed, then here's an example:
I have a stable, not current version of the code installed on my computer. I spin up a VM to test on, and it has an identical file structure, almost like I want the dev environment as close to production as possible. It's available, but not relevant. I remote debug, and PyCharm, in its vast intelligence, decides to ignore the mappings that I gave it and use the stable release instead. Unfortunately, that release is before a major refactor and is completely useless.
Remote debugging should still act remote even if it's not. Sorry about the rant, but I've been trying to figure this out and debug an issue for literally the past 12 hours. I could probably go use a free software like Eclipse for this, but...this feature is paid for.... I shouldn't need to rant about this.
Does anyone have a decent solution that doesn't involve waiting for an update to PyCharm?
My guess would be a way to isolate that folder from PyCharm so it won't think I have access to it without breaking Kodi, but I don't know of such a thing in Windows.
Even if it's just a sad excuse behind the stupid idea to ignore Path Mappings, I would like to hear from JetBrains on this one. It sounds like one of those things that seemed like an idea to solve network latency issues but backfired miserably.