Bug 1632497 - Make YouCompleteMe clangd completer work. r=jgraham

We need to use the new Settings() API, instead of the deprecated
FlagsForFile. Though in practice we can just delegate to it and it works
out of the box.

Differential Revision: https://phabricator.services.mozilla.com/D72152
This commit is contained in:
Emilio Cobos Álvarez 2020-04-28 10:08:00 +00:00
Родитель b073baab86
Коммит 64c748af66
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -32,6 +32,13 @@ def _is_likely_cpp_header(filename):
cpp_file = filename[:-1] + 'cpp'
return os.path.exists(cpp_file)
def Settings(**kwargs):
if kwargs[ 'language' ] == 'cfamily':
return FlagsForFile(kwargs['filename'])
return {}
def FlagsForFile(filename):
output = subprocess.check_output([path, 'compileflags', filename])
output = output.decode('utf-8')