summaryrefslogtreecommitdiff
path: root/.ycm_extra_conf.py
diff options
context:
space:
mode:
authorJiahui Xie <jiahui.xie@outlook.com>2017-11-28 08:42:50 -0700
committerJiahui Xie <jiahui.xie@outlook.com>2017-11-28 08:42:50 -0700
commit50918c2c33a4cbb75e96fc5ac8cf67d804104bcf (patch)
treea8dbbb36938b929611308612eab9182169a9b355 /.ycm_extra_conf.py
parent1c5ea5913e2db15b45d8c2fbe96c6a769850a4e5 (diff)
downloadsystemd-50918c2c33a4cbb75e96fc5ac8cf67d804104bcf.tar.gz
ycm: refactor the global variables used in the configuration
Diffstat (limited to '.ycm_extra_conf.py')
-rw-r--r--.ycm_extra_conf.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py
index b388b1afa7..c494d2a0bf 100644
--- a/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
@@ -46,6 +46,10 @@ import os
import ycm_core
+SOURCE_EXTENSIONS = (".C", ".cpp", ".cxx", ".cc", ".c", ".m", ".mm")
+HEADER_EXTENSIONS = (".H", ".h", ".hxx", ".hpp", ".hh")
+
+
def DirectoryOfThisScript():
return os.path.dirname(os.path.abspath(__file__))
@@ -126,8 +130,6 @@ if os.path.exists(compilation_database_folder):
else:
database = None
-SOURCE_EXTENSIONS = [".C", ".cpp", ".cxx", ".cc", ".c", ".m", ".mm"]
-
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
if not working_directory:
@@ -160,7 +162,7 @@ def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
def IsHeaderFile(filename):
extension = os.path.splitext(filename)[1]
- return extension in [".H", ".h", ".hxx", ".hpp", ".hh"]
+ return extension in HEADER_EXTENSIONS
def GetCompilationInfoForFile(filename):