forked from qt-creator/qt-creator
Added tooltips on completions proposals
Change-Id: Ic22b99e25159edfa4977e13c98f334ce75809af7 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
committed by
Eike Ziller
parent
f43c02d12f
commit
edabcb40fa
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user