diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2019-11-07 09:53:07 +0100 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2019-11-07 09:54:20 +0100 |
| commit | 0019684900491f517f3b08b4fa92740b69a8cc0f (patch) | |
| tree | 431f26087e35b6d4aab87a80b865f84ad6ca1683 | |
| parent | 6e8251046b96ae9b1ab8fc0f864266222856b5c5 (diff) | |
| download | bcm5719-llvm-0019684900491f517f3b08b4fa92740b69a8cc0f.tar.gz bcm5719-llvm-0019684900491f517f3b08b4fa92740b69a8cc0f.zip | |
[clangd] Set RetainCommentsFromSystemHeaders to true
clangd should retain comments from system headers.
fixes https://github.com/clangd/clangd/issues/96
Patch by lh123!
Differential revision: https://reviews.llvm.org/D69928
| -rw-r--r-- | clang-tools-extra/clangd/Compiler.cpp | 1 | ||||
| -rw-r--r-- | clang-tools-extra/clangd/index/IndexAction.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/Compiler.cpp b/clang-tools-extra/clangd/Compiler.cpp index e0801433319..795fd008259 100644 --- a/clang-tools-extra/clangd/Compiler.cpp +++ b/clang-tools-extra/clangd/Compiler.cpp @@ -63,6 +63,7 @@ buildCompilerInvocation(const ParseInputs &Inputs, // createInvocationFromCommandLine sets DisableFree. CI->getFrontendOpts().DisableFree = false; CI->getLangOpts()->CommentOpts.ParseAllComments = true; + CI->getLangOpts()->RetainCommentsFromSystemHeaders = true; return CI; } diff --git a/clang-tools-extra/clangd/index/IndexAction.cpp b/clang-tools-extra/clangd/index/IndexAction.cpp index 0814e7f0979..8fd2159932b 100644 --- a/clang-tools-extra/clangd/index/IndexAction.cpp +++ b/clang-tools-extra/clangd/index/IndexAction.cpp @@ -160,6 +160,7 @@ public: bool BeginInvocation(CompilerInstance &CI) override { // We want all comments, not just the doxygen ones. CI.getLangOpts().CommentOpts.ParseAllComments = true; + CI.getLangOpts().RetainCommentsFromSystemHeaders = true; // Index the whole file even if there are warnings and -Werror is set. // Avoids some analyses too. Set in two places as we're late to the party. CI.getDiagnosticOpts().IgnoreWarnings = true; |

