Skip to content

Commit 0019684

Browse files
committed
[clangd] Set RetainCommentsFromSystemHeaders to true
clangd should retain comments from system headers. fixes clangd/clangd#96 Patch by lh123! Differential revision: https://reviews.llvm.org/D69928
1 parent 6e82510 commit 0019684

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

clang-tools-extra/clangd/Compiler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ buildCompilerInvocation(const ParseInputs &Inputs,
6363
// createInvocationFromCommandLine sets DisableFree.
6464
CI->getFrontendOpts().DisableFree = false;
6565
CI->getLangOpts()->CommentOpts.ParseAllComments = true;
66+
CI->getLangOpts()->RetainCommentsFromSystemHeaders = true;
6667
return CI;
6768
}
6869

clang-tools-extra/clangd/index/IndexAction.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ class IndexAction : public ASTFrontendAction {
160160
bool BeginInvocation(CompilerInstance &CI) override {
161161
// We want all comments, not just the doxygen ones.
162162
CI.getLangOpts().CommentOpts.ParseAllComments = true;
163+
CI.getLangOpts().RetainCommentsFromSystemHeaders = true;
163164
// Index the whole file even if there are warnings and -Werror is set.
164165
// Avoids some analyses too. Set in two places as we're late to the party.
165166
CI.getDiagnosticOpts().IgnoreWarnings = true;

0 commit comments

Comments
 (0)