mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 17:11:59 +00:00
textDocument/signatureHelp: enable documentation
This commit is contained in:
parent
716bc01322
commit
cd0f204349
@ -91,10 +91,8 @@ public:
|
|||||||
|
|
||||||
const char *ret_type = nullptr;
|
const char *ret_type = nullptr;
|
||||||
SignatureInformation &ls_sig = ls_sighelp.signatures.emplace_back();
|
SignatureInformation &ls_sig = ls_sighelp.signatures.emplace_back();
|
||||||
#if LLVM_VERSION_MAJOR >= 8
|
|
||||||
const RawComment *RC = getCompletionComment(S.getASTContext(), Cand.getFunction());
|
const RawComment *RC = getCompletionComment(S.getASTContext(), Cand.getFunction());
|
||||||
ls_sig.documentation = RC ? RC->getBriefText(S.getASTContext()) : "";
|
ls_sig.documentation = RC ? RC->getBriefText(S.getASTContext()) : "";
|
||||||
#endif
|
|
||||||
for (const auto &Chunk : *CCS)
|
for (const auto &Chunk : *CCS)
|
||||||
switch (Chunk.Kind) {
|
switch (Chunk.Kind) {
|
||||||
case CodeCompletionString::CK_ResultType:
|
case CodeCompletionString::CK_ResultType:
|
||||||
@ -171,7 +169,7 @@ void MessageHandler::textDocument_signatureHelp(
|
|||||||
CodeCompleteOptions CCOpts;
|
CodeCompleteOptions CCOpts;
|
||||||
CCOpts.IncludeGlobals = false;
|
CCOpts.IncludeGlobals = false;
|
||||||
CCOpts.IncludeMacros = false;
|
CCOpts.IncludeMacros = false;
|
||||||
CCOpts.IncludeBriefComments = false;
|
CCOpts.IncludeBriefComments = true;
|
||||||
if (cache.IsCacheValid(path, begin_pos)) {
|
if (cache.IsCacheValid(path, begin_pos)) {
|
||||||
SignatureHelpConsumer Consumer(CCOpts, true);
|
SignatureHelpConsumer Consumer(CCOpts, true);
|
||||||
cache.WithLock([&]() { Consumer.ls_sighelp = cache.result; });
|
cache.WithLock([&]() { Consumer.ls_sighelp = cache.result; });
|
||||||
|
Loading…
Reference in New Issue
Block a user