TextEditor: make the format of completion item detail text adjustable

Instead of always assuming content in the form of rich text allow each
item individually to define it's text format for the detail text that is
shown as a tooltip of a completion item.

Fixes: QTCREATORBUG-22429
Change-Id: I9fa71373a743c26fa06d48acc5f0509584830ca0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-05-21 14:51:10 +02:00
parent 6fb9bf453f
commit cf30c12624
8 changed files with 34 additions and 5 deletions

View File

@@ -62,7 +62,8 @@ public:
virtual void apply(TextDocumentManipulatorInterface &manipulator, int basePosition) const = 0;
virtual QIcon icon() const = 0;
virtual QString detail() const = 0;
virtual bool isKeyword() const { return false; };
virtual bool isKeyword() const { return false; }
virtual Qt::TextFormat detailFormat() const { return Qt::AutoText; }
virtual bool isSnippet() const = 0;
virtual bool isValid() const = 0;
virtual quint64 hash() const = 0; // it is only for removing duplicates