Skip to content
Snippets Groups Projects
Commit 52b21ae2 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

add config for YCM completion engine

parent 5ff97dfb
Branches
Tags
No related merge requests found
......@@ -9,6 +9,7 @@
*.orig
*.lo
*.rej
*.pyc
.libs/
.deps/
.dirstamp
......
#!/usr/bin/python -Es
# vim: et:ts=4:sw=4:colorcolumn=100
#
# Configuration for You Complete Me (YCM) code-completion engine for Vim.
#
# This file is released into the public domain.
#
import sys
import os
DIR = os.path.dirname(__file__)
FLAGS = [
'-std=gnu99',
'-Wall', '-Wno-unused', '-Werror=implicit',
'-DCONFIG_DIR=', '-DRUN_DIR=', '-DSTORAGE_DIR=',
]
CONFIG_H = 'src/config.h'
INCLUDES = [
('src', []),
('tests', ['src', 'libtap']),
]
def relative_path(filename):
return os.path.relpath(filename, DIR)
def absolute_path(filename):
return os.path.normpath(os.path.join(DIR, filename))
def includes_for(filename):
relative = relative_path(filename)
for prefix, includes in INCLUDES:
if relative.startswith(prefix + '/'):
return [prefix] + includes
return []
def include_flag(path):
return "-I%s" % absolute_path(path)
def FlagsForFile(filename):
# input filename is an absolute path
config = ["-include", absolute_path(CONFIG_H)]
includes = [include_flag(f) for f in includes_for(filename)]
return {'flags': FLAGS + config + includes, 'do_cache': True}
if __name__ == '__main__':
print >>sys.stderr, "Not runnable."
sys.exit(1)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment