Commit edabcb40 authored by Sergey Shambir's avatar Sergey Shambir Committed by Eike Ziller
Browse files

Added tooltips on completions proposals



Change-Id: Ic22b99e25159edfa4977e13c98f334ce75809af7
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent f43c02d1
......@@ -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); }
......
......@@ -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()));
}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment