Merge #735 'nvim namespace fixes regarding YouCompleteMe'

This commit is contained in:
Justin M. Keyes 2014-05-19 10:46:18 -04:00
commit 32d018b57e

View File

@ -1,5 +1,6 @@
# .ycm_extra_conf.py for nvim source code.
import os, ycm_core
import os
import ycm_core
def DirectoryOfThisScript():
@ -7,7 +8,7 @@ def DirectoryOfThisScript():
def GetDatabase():
compilation_database_folder = DirectoryOfThisScript() + '/../build'
compilation_database_folder = DirectoryOfThisScript() + '/../../build'
if os.path.exists(compilation_database_folder):
return ycm_core.CompilationDatabase(compilation_database_folder)
return None
@ -24,9 +25,9 @@ def GetCompilationInfoForFile(filename):
return None
if IsHeaderFile(filename):
basename = os.path.splitext(filename)[0]
replacement_file = basename + '.c'
if os.path.exists(replacement_file):
compilation_info = database.GetCompilationInfoForFile(replacement_file)
c_file = basename + '.c'
if os.path.exists(c_file):
compilation_info = database.GetCompilationInfoForFile(c_file)
if compilation_info.compiler_flags_:
return compilation_info
return None