mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-10 00:58:20 +03:00
ycm: refactor the global variables used in the configuration
This commit is contained in:
parent
1c5ea5913e
commit
50918c2c33
@ -46,6 +46,10 @@ import os
|
|||||||
import ycm_core
|
import ycm_core
|
||||||
|
|
||||||
|
|
||||||
|
SOURCE_EXTENSIONS = (".C", ".cpp", ".cxx", ".cc", ".c", ".m", ".mm")
|
||||||
|
HEADER_EXTENSIONS = (".H", ".h", ".hxx", ".hpp", ".hh")
|
||||||
|
|
||||||
|
|
||||||
def DirectoryOfThisScript():
|
def DirectoryOfThisScript():
|
||||||
return os.path.dirname(os.path.abspath(__file__))
|
return os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
@ -126,8 +130,6 @@ if os.path.exists(compilation_database_folder):
|
|||||||
else:
|
else:
|
||||||
database = None
|
database = None
|
||||||
|
|
||||||
SOURCE_EXTENSIONS = [".C", ".cpp", ".cxx", ".cc", ".c", ".m", ".mm"]
|
|
||||||
|
|
||||||
|
|
||||||
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
|
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
|
||||||
if not working_directory:
|
if not working_directory:
|
||||||
@ -160,7 +162,7 @@ def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
|
|||||||
|
|
||||||
def IsHeaderFile(filename):
|
def IsHeaderFile(filename):
|
||||||
extension = os.path.splitext(filename)[1]
|
extension = os.path.splitext(filename)[1]
|
||||||
return extension in [".H", ".h", ".hxx", ".hpp", ".hh"]
|
return extension in HEADER_EXTENSIONS
|
||||||
|
|
||||||
|
|
||||||
def GetCompilationInfoForFile(filename):
|
def GetCompilationInfoForFile(filename):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user