Merge PR #378: Improve attached properties in scripting code completion

This commit is contained in:
Jenkins nymea 2020-05-10 22:56:40 +02:00
commit 589a2a40f8
3 changed files with 4 additions and 2 deletions

View File

@ -513,7 +513,7 @@ void CodeCompletion::update()
}
// Always append attached class names
foreach (const QString &s, m_attachedClasses.keys()) {
entries.append(CompletionModel::Entry(s, s, "type"));
entries.append(CompletionModel::Entry(s, s, "attachedProperty"));
}
// Add generic qml syntax

View File

@ -138,7 +138,7 @@ bool CompletionProxyModel::lessThan(const QModelIndex &source_left, const QModel
CompletionModel::Entry left = m_model->get(source_left.row());
CompletionModel::Entry right = m_model->get(source_right.row());
static QStringList ordering = {"property", "method", "event", "type", "keyword" };
static QStringList ordering = {"property", "method", "event", "type", "attachedProperty", "keyword" };
int leftOrder = ordering.indexOf(left.decoration);
int rightOrder = ordering.indexOf(right.decoration);

View File

@ -142,6 +142,8 @@ Rectangle {
return "yellow";
case "property":
return "#ff5555";
case "attachedProperty":
return "orange"
case "method":
return "blue";
case "event":