zachflower / vscode-uncrustify

Uncrustify code formatter extension for Visual Studio Code
MIT License
7 stars 5 forks source link

Cannot specify relative paths #5

Open ps-bond opened 3 years ago

ps-bond commented 3 years ago

Running via ssh (installed on ssh):

Specifying "uncrustify.executablePath.linux": "${workspaceFolder}/uncrustify/uncrustify" results in an error ENOENT, while "uncrustify.executablePath.linux": "/home/user/workspace/uncrustify/uncrustify" functions as expected.

(NB the config var uncrustify.configPath.linux does appear to accept ${workspaceFolder} )

ps-bond commented 3 years ago

OK, I've had a look and identified what I believe is the cause of the defect:

In util.ts, the configPath entry from settings.json explicitly expands ${workspaceFolder} (et al), while the executablePath entry is just read as text.

I'll try out some changes locally then do a PR if you're OK with that.

zachflower commented 3 years ago

Thanks for the report @ps-bond, a pull request would be greatly appreciated!

ps-bond commented 3 years ago

No problem; I've made the changes, just need to test them first.

ps-bond commented 3 years ago

Tested & in use on my system; seems to do what I wanted it to. Whether there's wisdom in having uncrustify as part of a dev repo is another matter...