ycm-core / ycmd

A code-completion & code-comprehension server
https://ycm-core.github.io/ycmd/
GNU General Public License v3.0
1.69k stars 764 forks source link

Fix vswhere for Build Tools #1753

Closed dkaszews closed 1 month ago

dkaszews commented 1 month ago

According to https://github.com/microsoft/vswhere/issues/22, vswhere.exe only finds full Visual Studio IDE instances. To find a naked Build Tools instance, one needs to explicitly add -products 'Microsoft.VisualStudio.Product.BuildTools' to the call, but that won't find IDE instances in turn.

The PR adds the second form as a fallback to support users who only have Build Tools installed without the full IDE.

> ./install.py --skip-build --verbose
Calling C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -latest -property installationVersion
vswhere returned nothing usable: ""
Retrying vswhere for Build Tools
Calling C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -latest -property installationVersion
 -products Microsoft.VisualStudio.Product.BuildTools
vswhere -latest returned version 17.10.35122.118

This change is Reviewable

bstaletic commented 1 month ago

Turns out i did not merge the CI pull request when I thought I had. Now that #1746 has been merged, please rebase again.

dkaszews commented 1 month ago

Rebased again

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.87%. Comparing base (74a5e71) to head (6f1f4f8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1753 +/- ## ========================================== + Coverage 95.49% 95.87% +0.38% ========================================== Files 52 84 +32 Lines 6947 8437 +1490 Branches 0 163 +163 ========================================== + Hits 6634 8089 +1455 + Misses 313 298 -15 - Partials 0 50 +50 ```
mergify[bot] commented 1 month ago

Thanks for sending a PR!