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

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

Issue 519903002: YCM works correctly when 'out' directory is a symlink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | no next file » | 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 f26d4beae4af03e0a1ebb537b912d1acdfd90f92..e5396e3b19b756f071032d4ee0dd7f543ede2151 100644
--- a/tools/vim/chromium.ycm_extra_conf.py
+++ b/tools/vim/chromium.ycm_extra_conf.py
@@ -38,6 +38,7 @@
import os
+import os.path
import subprocess
@@ -165,13 +166,13 @@ def GetClangCommandFromNinjaForFilename(chrome_root, filename):
# try to use the default flags.
return chrome_flags
- # Ninja needs the path to the source file from the output build directory.
- # Cut off the common part and /.
- subdir_filename = filename[len(chrome_root)+1:]
- rel_filename = os.path.join('..', '..', subdir_filename)
-
out_dir = GetNinjaOutputDirectory(chrome_root)
+ # Ninja needs the path to the source file relative to the output build
+ # directory.
+ rel_filename = os.path.relpath(os.path.realpath(filename),
eroman 2014/08/29 19:23:22 much nicer!
+ os.path.realpath(out_dir))
+
# Ask ninja how it would build our source file.
p = subprocess.Popen(['ninja', '-v', '-C', out_dir, '-t',
'commands', rel_filename + '^'],
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698