diff options
Diffstat (limited to 'clang-tools-extra/clangd/CodeCompletionStrings.h')
-rw-r--r-- | clang-tools-extra/clangd/CodeCompletionStrings.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/CodeCompletionStrings.h b/clang-tools-extra/clangd/CodeCompletionStrings.h index c29350d15e7..81d184cfba8 100644 --- a/clang-tools-extra/clangd/CodeCompletionStrings.h +++ b/clang-tools-extra/clangd/CodeCompletionStrings.h @@ -25,18 +25,25 @@ namespace clangd { /// markers stripped. See clang::RawComment::getFormattedText() for the detailed /// explanation of how the comment text is transformed. /// Returns empty string when no comment is available. +/// If \p CommentsFromHeaders parameter is set, only comments from the main +/// file will be returned. It is used to workaround crashes when parsing +/// comments in the stale headers, coming from completion preamble. std::string getDocComment(const ASTContext &Ctx, - const CodeCompletionResult &Result); + const CodeCompletionResult &Result, + bool CommentsFromHeaders); /// Gets a minimally formatted documentation for parameter of \p Result, /// corresponding to argument number \p ArgIndex. /// This currently looks for comments attached to the parameter itself, and /// doesn't extract them from function documentation. /// Returns empty string when no comment is available. +/// If \p CommentsFromHeaders parameter is set, only comments from the main +/// file will be returned. It is used to workaround crashes when parsing +/// comments in the stale headers, coming from completion preamble. std::string getParameterDocComment(const ASTContext &Ctx, const CodeCompleteConsumer::OverloadCandidate &Result, - unsigned ArgIndex); + unsigned ArgIndex, bool CommentsFromHeaders); /// Gets label and insert text for a completion item. For example, for function /// `Foo`, this returns <"Foo(int x, int y)", "Foo"> without snippts enabled. |