forked from qt-creator/qt-creator
QmlJSEditor: Set an icon for keyword completions.
This commit is contained in:
@@ -665,6 +665,7 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
|
|||||||
isQmlFile = true;
|
isQmlFile = true;
|
||||||
|
|
||||||
const QIcon symbolIcon = iconForColor(Qt::darkCyan);
|
const QIcon symbolIcon = iconForColor(Qt::darkCyan);
|
||||||
|
const QIcon keywordIcon = iconForColor(Qt::darkYellow);
|
||||||
|
|
||||||
Interpreter::Engine interp;
|
Interpreter::Engine interp;
|
||||||
Interpreter::Context context(&interp);
|
Interpreter::Context context(&interp);
|
||||||
@@ -697,6 +698,7 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
|
|||||||
foreach (const QString &word, Scanner::keywords()) {
|
foreach (const QString &word, Scanner::keywords()) {
|
||||||
TextEditor::CompletionItem item(this);
|
TextEditor::CompletionItem item(this);
|
||||||
item.text = word;
|
item.text = word;
|
||||||
|
item.icon = keywordIcon;
|
||||||
m_completions.append(item);
|
m_completions.append(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -708,6 +710,7 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
|
|||||||
foreach (const QString &word, qmlWords) {
|
foreach (const QString &word, qmlWords) {
|
||||||
TextEditor::CompletionItem item(this);
|
TextEditor::CompletionItem item(this);
|
||||||
item.text = word;
|
item.text = word;
|
||||||
|
item.icon = keywordIcon;
|
||||||
m_completions.append(item);
|
m_completions.append(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user