You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A clear and concise description of what the bug is.
I have my clang-format in a custom path, specifically $HOME/.local/bin/clang-format. I have this on two different computers, both of which I use to edit some code via sshfs. I want to be able to specify something like this in my user settings:
so that I get the same formatting functionality on both computers. Formatting works fine if I put in the absolute path with no variables, but all my attempts to use a variable have disabled the formatting functionality. I've tried "${env:HOME}/.local/bin/clang-format", "${env.HOME}/.local/bin/clang-format", "~/.local/bin/clang-format", and "$HOME/.local/bin/clang-format", all with no success. After any of these attempts if I replace the path with the absolute path it immediately works again.
Is there a way to use a variable here, or some other way to fix my problem?
There is no workaround right now (besides maybe editing the extension JavaScript yourself), but this is easy enough to fix. We should have it for the next update.
The fix I added will pick up the env in the clang_format_path when the extension starts, but any changes to the clang_format_path that has an env won't be picked up until a Reload Window is done...which seems okay to me (it'll fall back to the previous clang_format_path before the settings change).
Would this also fix the ability to use '${workspaceFolder}' in compilerPath?
I would like to use a 'dummy/proxy' compiler to return the include/defines to enable me to work cross-platform and need access to workspaceFolder in the path.
Activity
bobbrow commentedon Aug 1, 2018
There is no workaround right now (besides maybe editing the extension JavaScript yourself), but this is easy enough to fix. We should have it for the next update.
sean-mcmanus commentedon Aug 10, 2018
The fix I added will pick up the env in the clang_format_path when the extension starts, but any changes to the clang_format_path that has an env won't be picked up until a Reload Window is done...which seems okay to me (it'll fall back to the previous clang_format_path before the settings change).
benlindsay commentedon Aug 10, 2018
Sean McManus (@sean-mcmanus) Awesome, thanks so much! This will be a great feature to have :)
smhc commentedon Aug 12, 2018
Would this also fix the ability to use '${workspaceFolder}' in compilerPath?
I would like to use a 'dummy/proxy' compiler to return the include/defines to enable me to work cross-platform and need access to workspaceFolder in the path.
sean-mcmanus commentedon Aug 13, 2018
smhc Yes -- ${workspaceFolder} should work as well with our next release.
sean-mcmanus commentedon Aug 17, 2018
0.18.0 should have the fix (it doesn't need a Reload Window either, as mentioned previously).
benlindsay commentedon Aug 17, 2018
Sean McManus (@sean-mcmanus) works great! Thanks!