vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Search for compilerPath in the PATH environment variable

Open bobbrow opened this issue 6 years ago • 4 comments

A customer suggested this feature in an extension review. If compilerPath is not an absolute path to a compiler, we could see if it is in the PATH and determine the absolute path ourselves.

bobbrow avatar Aug 05 '20 20:08 bobbrow

Thank you for creating this issue 🙏🏻 many other VSCODE extensions that work with CPPTools have a problem with this and cannot create independent extensions. e.g. take a look at here I believe it could be better that all paths in the json config have access to the PATH environment variable.

robokamran avatar Aug 06 '20 05:08 robokamran

@bobbrow Should the env path also be checked for a default compiler? That may have an impact on launch time, as checking for N different names in path could be slow for some users.

Colengms avatar Aug 14 '20 02:08 Colengms

We already check the env path during the search for default compilers on linux/mac. This issue is just about resolving compilerPath in c_cpp_properties.json so that if you put 'g++' in there, we call 'which' on it and get the absolute path before sending the configuration across to the language server.

bobbrow avatar Aug 14 '20 16:08 bobbrow

Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.0.0

sean-mcmanus avatar Sep 14 '20 21:09 sean-mcmanus