Merge PR #378: Improve attached properties in scripting code completion
This commit is contained in:
commit
589a2a40f8
@ -513,7 +513,7 @@ void CodeCompletion::update()
|
|||||||
}
|
}
|
||||||
// Always append attached class names
|
// Always append attached class names
|
||||||
foreach (const QString &s, m_attachedClasses.keys()) {
|
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
|
// Add generic qml syntax
|
||||||
|
|||||||
@ -138,7 +138,7 @@ bool CompletionProxyModel::lessThan(const QModelIndex &source_left, const QModel
|
|||||||
CompletionModel::Entry left = m_model->get(source_left.row());
|
CompletionModel::Entry left = m_model->get(source_left.row());
|
||||||
CompletionModel::Entry right = m_model->get(source_right.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 leftOrder = ordering.indexOf(left.decoration);
|
||||||
int rightOrder = ordering.indexOf(right.decoration);
|
int rightOrder = ordering.indexOf(right.decoration);
|
||||||
|
|||||||
@ -142,6 +142,8 @@ Rectangle {
|
|||||||
return "yellow";
|
return "yellow";
|
||||||
case "property":
|
case "property":
|
||||||
return "#ff5555";
|
return "#ff5555";
|
||||||
|
case "attachedProperty":
|
||||||
|
return "orange"
|
||||||
case "method":
|
case "method":
|
||||||
return "blue";
|
return "blue";
|
||||||
case "event":
|
case "event":
|
||||||
|
|||||||
Reference in New Issue
Block a user