aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/YouCompleteMe/ycm_extra_conf.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/YouCompleteMe/ycm_extra_conf.py b/contrib/YouCompleteMe/ycm_extra_conf.py
index 9fd2ba8b8d..249220bb2b 100644
--- a/contrib/YouCompleteMe/ycm_extra_conf.py
+++ b/contrib/YouCompleteMe/ycm_extra_conf.py
@@ -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