Type: LanguageService
Describe the bug
Using just the .exe name of a compiler in compilerPath in c_cpp_properties.json causes it to fail. This has been happening since compilerPath was introduced. E.g. compilerPath: "g++"

Error in C/C++ Firmware Output window: Failed to query default include paths and defines for g++. WSL not detected
When I simply type g++ --version into a VSCode Powershell terminal, it works fine, so I have my PATH setup properly:

A more realistic example:
"compilerPath": "arm-none-eabi-g++ -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nosys.specs -specs=nano.specs -u _printf_float -u _scanf_float",

Failed to query default include paths and defines for arm-none-eabi-g++. WSL not detected

In Terminal: arm-none-eabi-g++ --version:

This is currently "by design", but given that we're looking to improve the configuration experience for our next release, this would be one way to help with that.
It seems adding env variable support will not break anything but in some cases will help a lot.
Example: on my computer I have 2 versions of Visual Studio and 20 (twenty) versions of cl.exe compiler. Managing this with single PATH variable is impractical. I have to use distinct environment variables to store paths to x86, x64, ARM current version to avoid hardcoding.
Also, current behavior is inconsistent with other config files (tasks, launch etc.).
We implemented this feature with PR #5965. It currently available in our 0.30.0-insiders3 which you can install by changing the C_Cpp.updateChannel setting to "Insiders".
Most helpful comment
This is currently "by design", but given that we're looking to improve the configuration experience for our next release, this would be one way to help with that.