LaurentTreguier / vscode-uncrustify

Code format using uncrustify
66 stars 10 forks source link

Cannot set absolute path for config file #26

Closed philectron closed 6 years ago

philectron commented 6 years ago

Hi,

In my VS Code's User Settings JSON file, I set "uncrustify.configPath": "~/.uncrustify/c_cpp_style.cfg" as that is the absolute path to my Uncrustify config.

I added path/to/my/folder to my VS Code workspace.

But when I tried to format my code, it said _"The uncrustify config file path is incorrect: path/to/my/folder/~/.uncrustify/c_cpp_style.cfg"_

I think the extension understood my uncrustify.configPath in the VS Code User Settings as the relative path to my workspace folder.

Is there any way to fix this? Thank you!

LaurentTreguier commented 6 years ago

If you use $HOME/.uncrustify/c_cpp_style.cfg, the $HOME variable should be expanded correctly

philectron commented 6 years ago

Still doesn't work. _"The uncrustify config file path is incorrect: path/to/my/folder/home/phil/.uncrustify/c_cpp_style.cfg"_

It did expand the $HOME variable, but it didn't treat it as an absolute path.