diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index 5e4e3d1e86cf534586e9c2dccde800e89ab7aed2..4eaafc6e30b0f2849049a6efe6007efde81e4408 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -536,7 +536,10 @@ public: ConvertToCompletionItem() : _item(0) , _symbol(0) - { } + { + overview.setShowReturnTypes(true); + overview.setShowArgumentNames(true); + } BasicProposalItem *operator()(Symbol *symbol) { @@ -575,7 +578,12 @@ protected: } virtual void visit(const Identifier *name) - { _item = newCompletionItem(name); } + { + _item = newCompletionItem(name); + if (!_symbol->isScope() || _symbol->isFunction()) { + _item->setDetail(overview.prettyType(_symbol->type(), name)); + } + } virtual void visit(const TemplateNameId *name) { @@ -587,7 +595,10 @@ protected: { _item = newCompletionItem(name); } virtual void visit(const OperatorNameId *name) - { _item = newCompletionItem(name); } + { + _item = newCompletionItem(name); + _item->setDetail(overview.prettyType(_symbol->type(), name)); + } virtual void visit(const ConversionNameId *name) { _item = newCompletionItem(name); } diff --git a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp index 324edea5b4c1e9e0998cb493dcd68963e7cb1577..d89c5864e57d4f023897b6ab510eadc652c801f2 100644 --- a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp @@ -39,6 +39,7 @@ #include <texteditor/texteditorsettings.h> #include <texteditor/completionsettings.h> +#include <texteditor/texteditorconstants.h> #include <utils/faketooltip.h> @@ -264,7 +265,7 @@ GenericProposalWidgetPrivate::GenericProposalWidgetPrivate(QWidget *completionWi connect(m_completionListView, SIGNAL(activated(QModelIndex)), this, SLOT(handleActivation(QModelIndex))); - m_infoTimer.setInterval(1000); + m_infoTimer.setInterval(Constants::COMPLETION_ASSIST_TOOLTIP_DELAY); m_infoTimer.setSingleShot(true); connect(&m_infoTimer, SIGNAL(timeout()), SLOT(maybeShowInfoTip())); } diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index 7d23fb3d7335251d61694ef436f74e9a0af20d3d..1231e598b1f7b4869a25a2e49f86145ca53615b3 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -181,6 +181,11 @@ const char TEXT_SNIPPET_GROUP_ID[] = "Text"; const char GLOBAL_SETTINGS_ID[] = "Global"; +/** + * Delay before tooltip will be shown near completion assistant proposal + */ +const unsigned COMPLETION_ASSIST_TOOLTIP_DELAY = 100; + } // namespace Constants } // namespace TextEditor