Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: tools/vim/chromium.ycm_extra_conf.py

Issue 2305443004: YCM: Support Objective-C and Objective-C++ (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/vim/tests/chromium.ycm_extra_conf_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/vim/chromium.ycm_extra_conf.py
diff --git a/tools/vim/chromium.ycm_extra_conf.py b/tools/vim/chromium.ycm_extra_conf.py
index 0db23070032748e7a09c24879f04cca83c70867a..a2f74a2f1089221cbe96a0eea728b510e3655f94 100644
--- a/tools/vim/chromium.ycm_extra_conf.py
+++ b/tools/vim/chromium.ycm_extra_conf.py
@@ -63,6 +63,10 @@ _default_flags = [
'c++',
]
+_extension_flags = {
+ '.m': ['-x', 'objective-c'],
+ '.mm': ['-x', 'objective-c++'],
+}
def PathExists(*args):
return os.path.exists(os.path.join(*args))
@@ -348,6 +352,7 @@ def FlagsForFile(filename):
'flags': (List of Strings) Command line flags.
'do_cache': (Boolean) True if the result should be cached.
"""
+ ext = os.path.splitext(filename)[1]
abs_filename = os.path.abspath(filename)
chrome_root = FindChromeSrcFromFilename(abs_filename)
clang_flags = GetClangOptionsFromNinjaForFilename(chrome_root, abs_filename)
@@ -357,7 +362,7 @@ def FlagsForFile(filename):
# determine the flags again.
should_cache_flags_for_file = bool(clang_flags)
- final_flags = _default_flags + clang_flags
+ final_flags = _default_flags + _extension_flags.get(ext, []) + clang_flags
return {
'flags': final_flags,
« no previous file with comments | « no previous file | tools/vim/tests/chromium.ycm_extra_conf_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698