LaurentTreguier / vscode-uncrustify

Code format using uncrustify
66 stars 10 forks source link

Cannot detect uncrustify executable #23

Closed eternalphane closed 6 years ago

eternalphane commented 6 years ago

Hi, the extension constantly complains Debug: uncrustify installed: false though I've set uncrustify.executablePath correctly. Since I manually build uncrustify from latest commit with VS2017, maybe that's the reason?

LaurentTreguier commented 6 years ago

The extension considers uncrustify to be "installed" when the executable is in the PATH variable. It shouldn't pose any problem if uncrustify.executablePath is set correctly, you can safely ignore it. It would constantly say Debug: uncrustify installed: true if uncrustify was in the PATH anyway.

eternalphane commented 6 years ago

Weird. Setting the PATH vatiable definitely works, but I can't reproduce the error anymore even if I remove uncrustify from PATH and use uncrustify.executablePath instead. Whatever, it works anyway. Thanks for your help.

eternalphane commented 6 years ago

Sorry, but the issue seems to still exist. Please check the following lines. https://github.com/LaurentTreguier/vscode-uncrustify/blob/67cdb4eb045ce52865f60c61485385d614d6666e/src/configurator.ts#L115 https://github.com/LaurentTreguier/vscode-uncrustify/blob/67cdb4eb045ce52865f60c61485385d614d6666e/src/extension.ts#L115

LaurentTreguier commented 6 years ago

Thanks for pointing out the code that needs to be patched ! I didn't use #24 because I prefer using a function instead of a variable for the executable path, this way you won't need to reload the extension after setting or changing executablePath.