Skip to content

Commit

Permalink
Merge pull request #491 from deffi420/better-builtin-includes-search
Browse files Browse the repository at this point in the history
Fix #238, libclang.py builtin includes search.

Also fixes #486.
  • Loading branch information
xaizek committed May 25, 2016
2 parents b3ce4fb + 6303dd1 commit 3c1a6ff
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions plugin/libclang.py
Expand Up @@ -40,15 +40,10 @@ def getBuiltinHeaderPath(library_path):

for path in knownPaths:
try:
files = os.listdir(path)
if len(files) >= 1:
files = sorted(files)
subDir = files[-1]
else:
subDir = '.'
path = path + "/" + subDir + "/include/"
arg = "-I" + path
if canFindBuiltinHeaders(index, [arg]):
subDirs = [f for f in os.listdir(path) if os.path.isdir(path + "/" + f)]
subDirs = sorted(subDirs) or ['.']
path = path + "/" + subDirs[-1] + "/include"
if canFindBuiltinHeaders(index, ["-I" + path]):
return path
except:
pass
Expand Down

0 comments on commit 3c1a6ff

Please sign in to comment.