void wxCodeCompletionBoxManager::ShowCompletionBox(wxStyledTextCtrl* ctrl, const TagEntryPtrVector_t& tags, size_t flags, int startPos, wxEvtHandler* eventObject) { DestroyCurrent(); CHECK_PTR_RET(ctrl); CHECK_COND_RET(!tags.empty()); m_box = new wxCodeCompletionBox(wxTheApp->GetTopWindow(), eventObject); m_box->SetFlags(flags); m_box->SetStartPos(startPos); m_stc = ctrl; CallAfter(&wxCodeCompletionBoxManager::DoShowCCBoxTags, tags); }
void LanguageServerCluster::OnSignatureHelp(LSPEvent& event) { IEditor* editor = clGetManager()->GetActiveEditor(); CHECK_PTR_RET(editor); // Signature help results are ready, display them in the editor const LSP::SignatureHelp& sighelp = event.GetSignatureHelp(); TagEntryPtrVector_t tags; LSPSignatureHelpToTagEntries(tags, sighelp); if(tags.empty()) { return; } editor->ShowCalltip(new clCallTip(tags)); }
void ContextBase::OnUserTypedXChars(const wxString& word) { // user typed more than 3 chars, display completion box with C++ keywords if(IsCommentOrString(GetCtrl().GetCurrentPos())) { return; } TagEntryPtrVector_t tags; if(TagsManagerST::Get()->GetCtagsOptions().GetFlags() & CC_CPP_KEYWORD_ASISST) { clCodeCompletionEvent ccEvt(wxEVT_CC_CODE_COMPLETE_LANG_KEYWORD); ccEvt.SetEditor(&GetCtrl()); ccEvt.SetWord(word); if(EventNotifier::Get()->ProcessEvent(ccEvt)) { tags = ccEvt.GetTags(); } if(!tags.empty()) { GetCtrl().ShowCompletionBox(tags, // list of tags word); // do not automatically insert word if there is only single choice } } }