WebKit Bugzilla
Attachment 358135 Details for
Bug 193055
: .ycm_extra_conf.py should handle XXXInlines.h
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193055-20181229192957.patch (text/plain), 3.03 KB, created by
Yusuke Suzuki
on 2018-12-29 02:30:00 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-12-29 02:30:00 PST
Size:
3.03 KB
patch
obsolete
>Subversion Revision: 239556 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 2842d800182ad71f6aa1308e45e47a6cb82481e3..d83be881ff7b2742828354ce7ca47ab677911456 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,21 @@ >+2018-12-29 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ .ycm_extra_conf.py should handle XXXInlines.h >+ https://bugs.webkit.org/show_bug.cgi?id=193055 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ compile_commands.json database only records flags and options for cpp source files. >+ So, when we open headers, this database does not have any information for that. >+ Our .ycm_extra_conf.py alleviates this by using XXX.cpp's configuration for XXX.h. >+ But this mitigation does not handle XXXInlines.h well since we do not have XXXInlines.cpp. >+ This patch adds support for XXXInlines.h in .ycm_extra_conf.py. When XXXInlines.h is queried, >+ we attempt to find XXX.cpp and use the configuration if it exists. >+ >+ * gtk/ycm_extra_conf.py: >+ (getImplementationFilename): >+ (FlagsForFile): >+ > 2018-12-27 Alex Christensen <achristensen@webkit.org> > > Resurrect Mac CMake build >diff --git a/Tools/gtk/ycm_extra_conf.py b/Tools/gtk/ycm_extra_conf.py >index c1309bca39f17d7937570fd9ff7ffc1f95a0bd9c..0c540130e28d3bc457c95d01afd5383dbe5a67bf 100644 >--- a/Tools/gtk/ycm_extra_conf.py >+++ b/Tools/gtk/ycm_extra_conf.py >@@ -81,6 +81,16 @@ def get_build_path(): > return release_build_path if release_mtime >= debug_mtime else debug_build_path > > >+def getImplementationFilename(filename): >+ alternative_extensions = ['.cpp', '.c'] >+ for alternative_extension in alternative_extensions: >+ alternative_filename = filename[:-2] + alternative_extension >+ if os.path.exists(alternative_filename): >+ return alternative_filename >+ else: >+ return None >+ >+ > def FlagsForFile(filename, **kwargs): > """This is the main entry point for YCM. Its interface is fixed. > >@@ -97,14 +107,16 @@ def FlagsForFile(filename, **kwargs): > > # Headers can't be built, so we get the source file flags instead. > if filename.endswith('.h'): >- alternative_extensions = ['.cpp', '.c'] >- for alternative_extension in alternative_extensions: >- alternative_filename = filename[:-2] + alternative_extension >- if os.path.exists(alternative_filename): >- filename = alternative_filename >- break >+ implementationFilename = getImplementationFilename(filename) >+ if implementationFilename: >+ filename = implementationFilename > else: >- return result >+ if not filename.endswith('Inlines.h'): >+ return result >+ implementationFilename = getImplementationFilename(filename[:-len('Inlines.h')] + '.h') >+ if not implementationFilename: >+ return result >+ filename = implementationFilename > # Force config.h file inclusion, for GLib macros. > result['flags'].append("-includeconfig.h") >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
cgarcia
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193055
: 358135