forked from qt-creator/qt-creator
ClangCodeModel: Special rendering for deprecated completion items
We add the attribute textually and show a warning icon. Fixes: QTCREATORBUG-2325 Change-Id: Icc0305a703e26c84095167087b30fa3456f97614 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -227,6 +227,15 @@ bool LanguageClientCompletionItem::isPerfectMatch(int pos, QTextDocument *doc) c
|
||||
return textToInsert == textAt(QTextCursor(doc), pos - length, length);
|
||||
}
|
||||
|
||||
bool LanguageClientCompletionItem::isDeprecated() const
|
||||
{
|
||||
if (const auto tags = m_item.tags(); tags && tags->contains(CompletionItem::Deprecated))
|
||||
return true;
|
||||
if (const auto deprecated = m_item.deprecated())
|
||||
return *deprecated;
|
||||
return false;
|
||||
}
|
||||
|
||||
class LanguageClientCompletionModel : public GenericProposalModel
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user