diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 61c9cd2e1c..e258a0eb6f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -92,7 +92,7 @@ jobs:
- name: Install Python
uses: deadsnakes/action@v2.1.1
with:
- python-version: 3.9
+ python-version: '3.10'
debug: true
- name: Install GCC
run: |
@@ -124,15 +124,19 @@ jobs:
strategy:
fail-fast: false
matrix:
- runs-on: [ windows-2019 ]
+ runs-on: [ windows-2022 ]
benchmark: [ true, false ]
python-arch: [ 'x64', 'x86' ]
- msvc: [ 16 ]
+ msvc: [ 17 ]
exclude:
- - runs-on: windows-2019
+ - runs-on: windows-2022
benchmark: true
python-arch: 'x86'
include:
+ - runs-on: windows-2019
+ benchmark: false
+ python-arch: 'x64'
+ msvc: 16
- runs-on: windows-2016
benchmark: false
python-arch: 'x64'
@@ -156,7 +160,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v2
with:
- python-version: 3.9
+ python-version: '3.10'
architecture: ${{ matrix.python-arch }}
- name: Install Go
if: matrix.benchmark == false
diff --git a/.mergify.yml b/.mergify.yml
index c79bbde270..7c98af7fc8 100644
--- a/.mergify.yml
+++ b/.mergify.yml
@@ -12,8 +12,9 @@ pull_request_rules:
- status-success=C++ Lint
- status-success=Windows MSVC 15 x64 - test run
- status-success=Windows MSVC 16 x64 - test run
- - status-success=Windows MSVC 16 x86 - test run
- - status-success=Windows MSVC 16 x64 - C++ Benchmark
+ - status-success=Windows MSVC 17 x64 - test run
+ - status-success=Windows MSVC 17 x86 - test run
+ - status-success=Windows MSVC 17 x64 - C++ Benchmark
- status-success=code-review/reviewable
actions:
merge:
@@ -33,8 +34,9 @@ pull_request_rules:
- status-success=C++ Lint
- status-success=Windows MSVC 15 x64 - test run
- status-success=Windows MSVC 16 x64 - test run
- - status-success=Windows MSVC 16 x86 - test run
- - status-success=Windows MSVC 16 x64 - C++ Benchmark
+ - status-success=Windows MSVC 17 x64 - test run
+ - status-success=Windows MSVC 17 x86 - test run
+ - status-success=Windows MSVC 17 x64 - C++ Benchmark
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py
index 20fb9c1448..07ead1ad82 100644
--- a/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
@@ -186,9 +186,6 @@ def PythonSysPath( **kwargs ):
sys_path = kwargs[ 'sys_path' ]
interpreter_path = kwargs[ 'interpreter_path' ]
- major_version = subprocess.check_output( [
- interpreter_path, '-c', 'import sys; print( sys.version_info[ 0 ] )' ]
- ).rstrip().decode( 'utf8' )
sys_path[ 0:0 ] = [ p.join( DIR_OF_THIS_SCRIPT ),
p.join( DIR_OF_THIRD_PARTY, 'bottle' ),
diff --git a/TESTS.md b/TESTS.md
index 116c918412..c82ae651cf 100644
--- a/TESTS.md
+++ b/TESTS.md
@@ -45,7 +45,7 @@ To run the full suite, just run `run_tests.py`. Options are:
everything is built;
* `--no-completers`: do not build or test with listed semantic completion engine(s);
* `--completers`: only build and test with listed semantic completion engine(s);
-* `--msvc`: the Microsoft Visual C++ version to build with (default: 15).
+* `--msvc`: the Microsoft Visual C++ version to build with (default: 16).
Windows only;
* `--coverage`: generate code coverage data.
diff --git a/benchmark.py b/benchmark.py
index 33e61fc014..ac1b32d847 100755
--- a/benchmark.py
+++ b/benchmark.py
@@ -16,7 +16,7 @@
def ParseArguments():
parser = argparse.ArgumentParser()
- parser.add_argument( '--msvc', type = int, choices = [ 14, 15, 16 ],
+ parser.add_argument( '--msvc', type = int, choices = [ 15, 16, 17 ],
default = 16, help = 'Choose the Microsoft Visual '
'Studio version (default: %(default)s).' )
diff --git a/build.py b/build.py
index add345dcf2..d12aac9f05 100755
--- a/build.py
+++ b/build.py
@@ -19,6 +19,21 @@
import tempfile
import urllib.request
+
+class InstallationFailed( Exception ):
+ def __init__( self, message = None, exit_code = 1 ):
+ self.message = message
+ self.exit_code = exit_code
+
+ def Print( self ):
+ if self.message:
+ print( '', file = sys.stderr )
+ print( self.message, file = sys.stderr )
+
+ def Exit( self ):
+ sys.exit( self.exit_code )
+
+
IS_MSYS = 'MSYS' == os.environ.get( 'MSYSTEM' )
IS_64BIT = sys.maxsize > 2**32
@@ -85,11 +100,11 @@
BUILD_ERROR_MESSAGE = (
'ERROR: the build failed.\n\n'
- 'NOTE: it is *highly* unlikely that this is a bug but rather\n'
- 'that this is a problem with the configuration of your system\n'
- 'or a missing dependency. Please carefully read CONTRIBUTING.md\n'
- 'and if you\'re sure that it is a bug, please raise an issue on the\n'
- 'issue tracker, including the entire output of this script\n'
+ 'NOTE: it is *highly* unlikely that this is a bug but rather '
+ 'that this is a problem with the configuration of your system '
+ 'or a missing dependency. Please carefully read CONTRIBUTING.md '
+ 'and if you\'re sure that it is a bug, please raise an issue on the '
+ 'issue tracker, including the entire output of this script (with --verbose) '
'and the invocation line used to run it.' )
CLANGD_VERSION = '13.0.0'
@@ -164,8 +179,8 @@ def FindExecutableOrDie( executable, message ):
path = FindExecutable( executable )
if not path:
- sys.exit( f"ERROR: Unable to find executable '{ executable }'. "
- f"{ message }" )
+ raise InstallationFailed(
+ f"ERROR: Unable to find executable '{ executable }'. { message }" )
return path
@@ -249,8 +264,9 @@ def _CheckCall( args, **kwargs ):
print( "FAILED" )
if exit_message:
- sys.exit( exit_message )
- sys.exit( error.returncode )
+ raise InstallationFailed( exit_message )
+
+ raise InstallationFailed( exit_code = error.returncode )
def GetGlobalPythonPrefix():
@@ -280,7 +296,8 @@ def GetPossiblePythonLibraryDirectories():
def FindPythonLibraries():
include_dir = sysconfig.get_config_var( 'INCLUDEPY' )
if not p.isfile( p.join( include_dir, 'Python.h' ) ):
- sys.exit( NO_PYTHON_HEADERS_ERROR.format( include_dir = include_dir ) )
+ raise InstallationFailed(
+ NO_PYTHON_HEADERS_ERROR.format( include_dir = include_dir ) )
library_dirs = GetPossiblePythonLibraryDirectories()
@@ -326,10 +343,11 @@ def FindPythonLibraries():
if static_libraries and not OnWindows():
dynamic_flag = ( '--enable-framework' if OnMac() else
'--enable-shared' )
- sys.exit( NO_DYNAMIC_PYTHON_ERROR.format( library = static_libraries[ 0 ],
- flag = dynamic_flag ) )
+ raise InstallationFailed(
+ NO_DYNAMIC_PYTHON_ERROR.format( library = static_libraries[ 0 ],
+ flag = dynamic_flag ) )
- sys.exit( NO_PYTHON_LIBRARY_ERROR )
+ raise InstallationFailed( NO_PYTHON_LIBRARY_ERROR )
def CustomPythonCmakeArgs( args ):
@@ -359,6 +377,8 @@ def GetGenerator( args ):
# Studio 16 generator.
if args.msvc == 16:
return 'Visual Studio 16'
+ if args.msvc == 17:
+ return 'Visual Studio 17 2022'
return f"Visual Studio { args.msvc }{ ' Win64' if IS_64BIT else '' }"
return 'Unix Makefiles'
@@ -385,7 +405,7 @@ def ParseArguments():
parser.add_argument( '--system-libclang', action = 'store_true',
help = 'Use system libclang instead of downloading one '
'from llvm.org. NOT RECOMMENDED OR SUPPORTED!' )
- parser.add_argument( '--msvc', type = int, choices = [ 15, 16 ],
+ parser.add_argument( '--msvc', type = int, choices = [ 15, 16, 17 ],
default = 16, help = 'Choose the Microsoft Visual '
'Studio version (default: %(default)s).' )
parser.add_argument( '--ninja', action = 'store_true',
@@ -407,10 +427,24 @@ def ParseArguments():
'specified directory, and do not delete the '
'build output. This is useful for incremental '
'builds, and required for coverage data' )
+
+ # Historically, "verbose" mode was the default and --quiet was added. Now,
+ # quiet is the default (but the argument is still allowed, to avoid breaking
+ # scripts), and --verbose is added to get the full output.
parser.add_argument( '--quiet',
action = 'store_true',
+ default = True, # This argument is deprecated
help = 'Quiet installation mode. Just print overall '
- 'progress and errors' )
+ 'progress and errors. This is the default, so '
+ 'this flag is actually ignored. Ues --verbose '
+ 'to see more output.' )
+ parser.add_argument( '--verbose',
+ action = 'store_false',
+ dest = 'quiet',
+ help = 'Verbose installation mode; prints output from '
+ 'build operations. Useful for debugging '
+ 'build failures.' )
+
parser.add_argument( '--skip-build',
action = 'store_true',
help = "Don't build ycm_core lib, just install deps" )
@@ -463,8 +497,9 @@ def ParseArguments():
if ( args.system_libclang and
not args.clang_completer and
not args.all_completers ):
- sys.exit( 'ERROR: you can\'t pass --system-libclang without also passing '
- '--clang-completer or --all as well.' )
+ raise InstallationFailed(
+ 'ERROR: you can\'t pass --system-libclang without also passing '
+ '--clang-completer or --all as well.' )
return args
@@ -476,16 +511,17 @@ def FindCmake( args ):
cmake = PathToFirstExistingExecutable( cmake_exe )
if cmake is None:
- sys.exit( "ERROR: Unable to find cmake executable in any of"
- f" { cmake_exe }. CMake is required to build ycmd" )
+ raise InstallationFailed(
+ "ERROR: Unable to find cmake executable in any of"
+ f" { cmake_exe }. CMake is required to build ycmd" )
return cmake
def GetCmakeCommonArgs( args ):
cmake_args = [ '-G', GetGenerator( args ) ]
- # Set the architecture for the Visual Studio 16 generator.
- if OnWindows() and args.msvc == 16 and not args.ninja and not IS_MSYS:
+ # Set the architecture for the Visual Studio 16/17 generator.
+ if OnWindows() and args.msvc >= 16 and not args.ninja and not IS_MSYS:
arch = 'x64' if IS_64BIT else 'Win32'
cmake_args.extend( [ '-A', arch ] )
@@ -587,8 +623,8 @@ def ExitIfYcmdLibInUseOnWindows():
open( p.join( ycmd_library ), 'a' ).close()
except IOError as error:
if error.errno == errno.EACCES:
- sys.exit( 'ERROR: ycmd library is currently in use. '
- 'Stop all ycmd instances before compilation.' )
+ raise InstallationFailed( 'ERROR: ycmd library is currently in use. '
+ 'Stop all ycmd instances before compilation.' )
def GetCMakeBuildConfiguration( args ):
@@ -1042,8 +1078,9 @@ def GetClangdTarget():
return [
( 'clangd-{version}-x86_64-unknown-linux-gnu',
'5fc913b474a142a1796a598167a1227552eb4346b5f500a0594c876165f408ad' ) ]
- sys.exit( CLANGD_BINARIES_ERROR_MESSAGE.format( version = CLANGD_VERSION,
- platform = 'this system' ) )
+ raise InstallationFailed(
+ CLANGD_BINARIES_ERROR_MESSAGE.format( version = CLANGD_VERSION,
+ platform = 'this system' ) )
def DownloadClangd( printer ):
@@ -1074,7 +1111,8 @@ def DownloadClangd( printer ):
printer( f"Downloading Clangd from { download_url }..." )
DownloadFileTo( download_url, file_name )
if not CheckFileIntegrity( file_name, check_sum ):
- sys.exit( 'ERROR: downloaded Clangd archive does not match checksum.' )
+ raise InstallationFailed(
+ 'ERROR: downloaded Clangd archive does not match checksum.' )
printer( f"Extracting Clangd to { CLANGD_OUTPUT_DIR }..." )
with tarfile.open( file_name ) as package_tar:
@@ -1155,6 +1193,21 @@ def DoCmakeBuilds( args ):
BuildWatchdogModule( args )
+def PrintReRunMessage():
+ print( '',
+ 'The installation failed; please see above for the actual error. '
+ 'In order to get more information, please re-run the command, '
+ 'adding the --verbose flag. If you think this is a bug and you '
+ 'raise an issue, you MUST include the *full verbose* output.',
+ '',
+ 'For example, run:' + shlex.join( [ sys.executable ] +
+ sys.argv +
+ [ '--verbose' ] ),
+ '',
+ file = sys.stderr,
+ sep = '\n' )
+
+
def Main(): # noqa: C901
args = ParseArguments()
@@ -1164,22 +1217,34 @@ def Main(): # noqa: C901
else:
sys.exit( 'This script should not be run with sudo.' )
- if not args.skip_build:
- DoCmakeBuilds( args )
- if args.cs_completer or args.omnisharp_completer or args.all_completers:
- EnableCsCompleter( args )
- if args.go_completer or args.gocode_completer or args.all_completers:
- EnableGoCompleter( args )
- if args.js_completer or args.tern_completer or args.all_completers:
- EnableJavaScriptCompleter( args )
- if args.rust_completer or args.racer_completer or args.all_completers:
- EnableRustCompleter( args )
- if args.java_completer or args.all_completers:
- EnableJavaCompleter( args )
- if args.ts_completer or args.all_completers:
- EnableTypeScriptCompleter( args )
- if args.clangd_completer or args.all_completers:
- EnableClangdCompleter( args )
+ try:
+ if not args.skip_build:
+ DoCmakeBuilds( args )
+ if args.cs_completer or args.omnisharp_completer or args.all_completers:
+ EnableCsCompleter( args )
+ if args.go_completer or args.gocode_completer or args.all_completers:
+ EnableGoCompleter( args )
+ if args.js_completer or args.tern_completer or args.all_completers:
+ EnableJavaScriptCompleter( args )
+ if args.rust_completer or args.racer_completer or args.all_completers:
+ EnableRustCompleter( args )
+ if args.java_completer or args.all_completers:
+ EnableJavaCompleter( args )
+ if args.ts_completer or args.all_completers:
+ EnableTypeScriptCompleter( args )
+ if args.clangd_completer or args.all_completers:
+ EnableClangdCompleter( args )
+ except InstallationFailed as e:
+ e.Print()
+ if args.quiet:
+ PrintReRunMessage()
+ e.Exit()
+ except Exception as e:
+ if args.quiet:
+ print( f"FAILED with exception { type( e ).__name__ }: { e }" )
+ PrintReRunMessage()
+ else:
+ raise
if __name__ == '__main__':
diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt
index 023a6f0a78..24fa31f863 100644
--- a/cpp/ycm/CMakeLists.txt
+++ b/cpp/ycm/CMakeLists.txt
@@ -156,8 +156,7 @@ endif()
if ( USE_CLANG_COMPLETER )
message( STATUS "Using libclang to provide semantic completion for C/C++/ObjC" )
else()
- message( STATUS "NOT using libclang, no semantic completion for "
- "C/C++/ObjC will be available" )
+ message( STATUS "Not using libclang for C/C++/ObjC." )
endif()
if ( NOT LIBCLANG_FILENAME AND PATH_TO_LLVM_ROOT )
@@ -454,6 +453,4 @@ if( USE_CLANG_TIDY )
else()
message( STATUS "clang-tidy not found" )
endif()
-else()
- message( STATUS "NOT using clang-tidy for static analysis." )
endif()
diff --git a/run_tests.py b/run_tests.py
index 72acfe2c16..e972e2acb8 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -132,7 +132,7 @@ def ParseArguments():
choices = COMPLETERS.keys() )
parser.add_argument( '--skip-build', action = 'store_true',
help = 'Do not build ycmd before testing.' )
- parser.add_argument( '--msvc', type = int, choices = [ 14, 15, 16 ],
+ parser.add_argument( '--msvc', type = int, choices = [ 15, 16, 17 ],
default = 16, help = 'Choose the Microsoft Visual '
'Studio version (default: %(default)s).' )
parser.add_argument( '--coverage', action = 'store_true',
diff --git a/ycmd/completers/typescript/typescript_completer.py b/ycmd/completers/typescript/typescript_completer.py
index fdc544d49f..b4fa028ee3 100644
--- a/ycmd/completers/typescript/typescript_completer.py
+++ b/ycmd/completers/typescript/typescript_completer.py
@@ -207,6 +207,10 @@ def _StartServerNoLock( self ):
environ = os.environ.copy()
environ[ 'TSS_LOG' ] = tsserver_log
+ # TSServer runs out of memory on larger projects. This is the value that
+ # VSCode uses.
+ environ[ 'NODE_OPTIONS' ] = '--max_old_space_size=3072'
+
LOGGER.info( 'TSServer log file: %s', self._logfile )
# We need to redirect the error stream to the output one on Windows.
diff --git a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-named-like-folder/not-testy/testy.csproj b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-named-like-folder/not-testy/testy.csproj
index 1f1c0dd139..e8b5f0cffc 100644
--- a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-named-like-folder/not-testy/testy.csproj
+++ b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-named-like-folder/not-testy/testy.csproj
@@ -9,6 +9,8 @@
Exe
testy
testy
+ v4.8
+
true
@@ -38,4 +40,4 @@
-
\ No newline at end of file
+
diff --git a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-named-like-folder/testy/testy.csproj b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-named-like-folder/testy/testy.csproj
index 1f1c0dd139..e8b5f0cffc 100644
--- a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-named-like-folder/testy/testy.csproj
+++ b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-named-like-folder/testy/testy.csproj
@@ -9,6 +9,8 @@
Exe
testy
testy
+ v4.8
+
true
@@ -38,4 +40,4 @@
-
\ No newline at end of file
+
diff --git a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-abs/testy/testy.csproj b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-abs/testy/testy.csproj
index 1f1c0dd139..e8b5f0cffc 100644
--- a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-abs/testy/testy.csproj
+++ b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-abs/testy/testy.csproj
@@ -9,6 +9,8 @@
Exe
testy
testy
+ v4.8
+
true
@@ -38,4 +40,4 @@
-
\ No newline at end of file
+
diff --git a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-bad/testy/testy.csproj b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-bad/testy/testy.csproj
index 1f1c0dd139..e8b5f0cffc 100644
--- a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-bad/testy/testy.csproj
+++ b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-bad/testy/testy.csproj
@@ -9,6 +9,8 @@
Exe
testy
testy
+ v4.8
+
true
@@ -38,4 +40,4 @@
-
\ No newline at end of file
+
diff --git a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-rel/testy/testy.csproj b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-rel/testy/testy.csproj
index 1f1c0dd139..e8b5f0cffc 100644
--- a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-rel/testy/testy.csproj
+++ b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/extra-conf-rel/testy/testy.csproj
@@ -9,6 +9,8 @@
Exe
testy
testy
+ v4.8
+
true
@@ -38,4 +40,4 @@
-
\ No newline at end of file
+
diff --git a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/testy/testy.csproj b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/testy/testy.csproj
index 1f1c0dd139..e8b5f0cffc 100644
--- a/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/testy/testy.csproj
+++ b/ycmd/tests/cs/testdata/testy-multiple-solutions/solution-not-named-like-folder/testy/testy.csproj
@@ -9,6 +9,8 @@
Exe
testy
testy
+ v4.8
+
true
@@ -38,4 +40,4 @@
-
\ No newline at end of file
+
diff --git a/ycmd/tests/cs/testdata/testy/testy.csproj b/ycmd/tests/cs/testdata/testy/testy.csproj
index fde0a3622d..a6f52885d0 100644
--- a/ycmd/tests/cs/testdata/testy/testy.csproj
+++ b/ycmd/tests/cs/testdata/testy/testy.csproj
@@ -9,6 +9,8 @@
Exe
testy
testy
+ v4.8
+
true
@@ -43,4 +45,4 @@
-
\ No newline at end of file
+
diff --git "a/ycmd/tests/cs/testdata/\320\275\320\265\320\277\321\200\320\270\320\273\320\270\321\207\320\275\320\276\320\265 \321\201\320\273\320\276\320\262\320\276/a project.csproj" "b/ycmd/tests/cs/testdata/\320\275\320\265\320\277\321\200\320\270\320\273\320\270\321\207\320\275\320\276\320\265 \321\201\320\273\320\276\320\262\320\276/a project.csproj"
index b630affc44..800f5a87a7 100644
--- "a/ycmd/tests/cs/testdata/\320\275\320\265\320\277\321\200\320\270\320\273\320\270\321\207\320\275\320\276\320\265 \321\201\320\273\320\276\320\262\320\276/a project.csproj"
+++ "b/ycmd/tests/cs/testdata/\320\275\320\265\320\277\321\200\320\270\320\273\320\270\321\207\320\275\320\276\320\265 \321\201\320\273\320\276\320\262\320\276/a project.csproj"
@@ -9,6 +9,8 @@
Exe
testy
testy
+ v4.8
+
true