Skip to content

Commit

Permalink
Allow skipping legacy clang completer with --all
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Jackson committed Aug 16, 2024
1 parent d0a561e commit 20e8117
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ def ParseArguments():
parser.add_argument( '--clang-completer', action = 'store_true',
help = 'Enable C-family semantic completion engine '
'through libclang.' )
parser.add_argument( '--no-clang-completer',
action = 'store_true',
help = 'Disable C-family semantic completion engine '
'through libclang.' )
parser.add_argument( '--clangd-completer', action = 'store_true',
help = 'Enable C-family semantic completion engine '
'through clangd lsp server.(EXPERIMENTAL)' )
Expand Down Expand Up @@ -579,6 +583,10 @@ def ParseArguments():
raise InstallationFailed(
'ERROR: you can\'t pass --system-libclang without also passing '
'--clang-completer or --all as well.' )

if args.no_clang_completer and args.clang_completer:
raise InstallationFailed(
'ERROR: you can\'t pass both --clang-completer and --no-clang-completer' )
return args


Expand Down Expand Up @@ -611,8 +619,9 @@ def GetCmakeCommonArgs( args ):

def GetCmakeArgs( parsed_args ):
cmake_args = []
if parsed_args.clang_completer or parsed_args.all_completers:
cmake_args.append( '-DUSE_CLANG_COMPLETER=ON' )
if not parsed_args.no_clang_completer:
if parsed_args.clang_completer or parsed_args.all_completers:
cmake_args.append( '-DUSE_CLANG_COMPLETER=ON' )

if parsed_args.clang_tidy:
cmake_args.append( '-DUSE_CLANG_TIDY=ON' )
Expand Down

0 comments on commit 20e8117

Please sign in to comment.