Open mpvl opened 8 years ago
While I understand the motivation, I'm not convinced adding environment variable expansion is the right move, mostly because it is sort of open-ended and may be harder to document.
Some thoughts related to the implementation and documentation I have are:
HOME
/USERPROFILE
?$HOME
on OS X and Linux and %USERPROFILE%
on Windows?GOPATH
and GOROOT
, or should it work in any string value?If I were to answer the question, I would probably say to do the following if we were going to add support:
$HOME
and %USERPROFILE%
GOPATH
and GOROOT
I opened #4 to address the error reporting issue. Let's focus this on variable expansion.
I like Will's suggestion of only offering this for a limited set of variables. But I think this could also be added later (post 1.0). That being said, I am not a heavy user of GoSublime, and can't comment on how useful that feature is/isn't to general users.
@mpvl Did you manually enter your GOPATH
into Sublime Text, or was your $GOPATH
env var set to $HOME/...
?
As a follow up, if you did enter it into the Sublime Text settings, was ST not able to fetch it from your shell?
If you did not enter it into the settings, could you execute the following in your Sublime Text console and tell me the output?
import shellenv
shell, env = shellenv.get_env()
env.get('GOPATH')
@mpvl Ping
@wbond another use case that would be addressed by this is appending to $PATH rather than overwriting it outright, which is currently (infuriatingly) the only option.
Go Sublime supported this, so it will make the transition from Go Sublime more straightforwards.
Alternatively, give a better error message that a given path could not be found. I got an error message that my GOPATH was not defined, rather than pointing to a non-existing directory.