-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C_Cpp.clang_format_path won't accept environment variable #2344
Comments
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). |
@sean-mcmanus Awesome, thanks so much! This will be a great feature to have :) |
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. |
@smhc Yes -- ${workspaceFolder} should work as well with our next release. |
0.18.0 should have the fix (it doesn't need a Reload Window either, as mentioned previously). |
@sean-mcmanus works great! Thanks! |
Type: LanguageService
Describe the bug
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?
Thanks in advance!
The text was updated successfully, but these errors were encountered: