Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ycm-core/ycmd
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3db0bfac2eb4a21dbbc960ec7f95c3b01db5aece
Choose a base ref
..
head repository: ycm-core/ycmd
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4856081b691d883d6f39e13923c7ec538f0e05ff
Choose a head ref
Showing with 5 additions and 7 deletions.
  1. +5 −7 build.py
12 changes: 5 additions & 7 deletions build.py
Original file line number Diff line number Diff line change
@@ -114,10 +114,10 @@ def Exit( self ):
'or use your system Clangd. '
'See the YCM docs for details on how to use a custom Clangd.' )

ACCEPTABLE_MSVC_VERSIONS = [ 17, 16, 15 ]

def UseVsWhere( quiet, vswhere_args ):
ACCEPTABLE_VERSIONS = [ 17, 16, 15 ]

def UseVsWhere( quiet, vswhere_args ):
if not quiet:
print( "Calling", *vswhere_args )
latest_full_v = subprocess.check_output( vswhere_args ).strip().decode()
@@ -130,7 +130,7 @@ def UseVsWhere( quiet, vswhere_args ):
if not quiet:
print( f'vswhere -latest returned version { latest_full_v }' )

if latest_v not in ACCEPTABLE_VERSIONS:
if latest_v not in ACCEPTABLE_MSVC_VERSIONS:
if latest_v > 17:
if not quiet:
print( f'MSVC Version { latest_full_v } is newer than expected.' )
@@ -141,14 +141,12 @@ def UseVsWhere( quiet, vswhere_args ):
return latest_v
else:
if not quiet:
print( f'vswhere returned nothing usable, { latest_full_v }' )
print( f'vswhere returned nothing usable: "{ latest_full_v }"' )

return None


def FindLatestMSVC( quiet, preview=False ):
ACCEPTABLE_VERSIONS = [ 17, 16, 15 ]

VSWHERE_EXE = os.path.join( os.environ[ 'ProgramFiles(x86)' ],
'Microsoft Visual Studio',
'Installer', 'vswhere.exe' )
@@ -177,7 +175,7 @@ def FindLatestMSVC( quiet, preview=False ):
import winreg
handle = winreg.ConnectRegistry( None, winreg.HKEY_LOCAL_MACHINE )
msvc = None
for i in ACCEPTABLE_VERSIONS:
for i in ACCEPTABLE_MSVC_VERSIONS:
if not quiet:
print( 'Trying to find '
rf'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\{ i }.0' )