Has anyone figured out a way to set up Pycharm suc...
# general
l
Has anyone figured out a way to set up Pycharm such that it can interpret pants sandbox file paths in terminal output (eg. in error logs) and make them clickable into the source file? This is probably my biggest annoyance with `pants run`ing things during development.
p
I donโ€™t think this answer your Q (or maybe it does in a primitive way) but on iTerm2 (and in IDE terminals?) holding down
command
on a Mac and clicking the file path opens the folder in Finder:
๐Ÿ™ 1
VSCode has this
code
cli where you can open folders. So you can do this
Copy code
(cd /private/var/folders/x7/dhdtyk6533118y9892k7fgt80000gn/T/pants-sandbox-k7JWwz && code .)
l
Right, sorry for being unclear, what I want to do is open the project file, rather than the file in the sandbox. That is, I want it to chop off all the sandbox paths and open the "real" file.
p
Oh ha I see. Yeah idk
๐Ÿ‘ 1
c
Pants has a feature to strip the sandbox part of the path, so you'd be left with the relative project path, if that helps? So if you have output that didn't strip the sandbox path, it could be an oversight/bug for this feature (such as a regexp miss, or not applied at all): https://github.com/pantsbuild/pants/blob/9244fcc8530ac93fcc7a8e0d1fdcbabe61090f36/src/python/pants/util/strutil.py#L132-L142
๐Ÿ™ 1