Complete with empty context

This commit is contained in:
Fangrui Song 2018-01-28 13:24:29 -08:00
parent bdb880e0a5
commit 80213e8a23

View File

@ -316,8 +316,9 @@ struct TextDocumentCompletionHandler : MessageHandler {
// results Only do this when trigger is not manual or context doesn't // results Only do this when trigger is not manual or context doesn't
// exist (for Atom support). // exist (for Atom support).
if (existing_completion.empty() && is_global_completion && if (existing_completion.empty() && is_global_completion &&
(!request->params.context || request->params.context->triggerKind == (request->params.context &&
lsCompletionTriggerKind::Invoked)) { request->params.context->triggerKind !=
lsCompletionTriggerKind::Invoked)) {
LOG_S(INFO) << "Existing completion is empty, no completion results " LOG_S(INFO) << "Existing completion is empty, no completion results "
"will be returned"; "will be returned";
Out_TextDocumentComplete out; Out_TextDocumentComplete out;