| OLD | NEW |
| 1 # Copyright 2015 the V8 project authors. All rights reserved. | 1 # Copyright 2015 the V8 project authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Autocompletion config for YouCompleteMe in V8. | 5 # Autocompletion config for YouCompleteMe in V8. |
| 6 # | 6 # |
| 7 # USAGE: | 7 # USAGE: |
| 8 # | 8 # |
| 9 # 1. Install YCM [https://github.com/Valloric/YouCompleteMe] | 9 # 1. Install YCM [https://github.com/Valloric/YouCompleteMe] |
| 10 # (Googlers should check out [go/ycm]) | 10 # (Googlers should check out [go/ycm]) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 import os | 36 import os |
| 37 import os.path | 37 import os.path |
| 38 import subprocess | 38 import subprocess |
| 39 import sys | 39 import sys |
| 40 | 40 |
| 41 | 41 |
| 42 # Flags from YCM's default config. | 42 # Flags from YCM's default config. |
| 43 flags = [ | 43 flags = [ |
| 44 '-DUSE_CLANG_COMPLETER', | 44 '-DUSE_CLANG_COMPLETER', |
| 45 '-std=gnu++0x', | 45 '-std=gnu++11', |
| 46 '-x', | 46 '-x', |
| 47 'c++', | 47 'c++', |
| 48 ] | 48 ] |
| 49 | 49 |
| 50 | 50 |
| 51 def PathExists(*args): | 51 def PathExists(*args): |
| 52 return os.path.exists(os.path.join(*args)) | 52 return os.path.exists(os.path.join(*args)) |
| 53 | 53 |
| 54 | 54 |
| 55 def FindV8SrcFromFilename(filename): | 55 def FindV8SrcFromFilename(filename): |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 'flags': (List of Strings) Command line flags. | 184 'flags': (List of Strings) Command line flags. |
| 185 'do_cache': (Boolean) True if the result should be cached. | 185 'do_cache': (Boolean) True if the result should be cached. |
| 186 """ | 186 """ |
| 187 v8_root = FindV8SrcFromFilename(filename) | 187 v8_root = FindV8SrcFromFilename(filename) |
| 188 v8_flags = GetClangCommandFromNinjaForFilename(v8_root, filename) | 188 v8_flags = GetClangCommandFromNinjaForFilename(v8_root, filename) |
| 189 final_flags = flags + v8_flags | 189 final_flags = flags + v8_flags |
| 190 return { | 190 return { |
| 191 'flags': final_flags, | 191 'flags': final_flags, |
| 192 'do_cache': True | 192 'do_cache': True |
| 193 } | 193 } |
| OLD | NEW |