forked from qt-creator/qt-creator
QmlJS: improve static initializings
Change-Id: Ifa37c912d0e43bcda896cb0ea851f97566c88d78 Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
@@ -853,17 +853,15 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface *
|
||||
|
||||
// add qml extra words
|
||||
if (doQmlKeywordCompletion && isQmlFile) {
|
||||
static QStringList qmlWords;
|
||||
static QStringList qmlWordsAlsoInJs;
|
||||
|
||||
if (qmlWords.isEmpty()) {
|
||||
qmlWords << QLatin1String("property")
|
||||
//<< QLatin1String("readonly")
|
||||
<< QLatin1String("signal")
|
||||
<< QLatin1String("import");
|
||||
}
|
||||
if (qmlWordsAlsoInJs.isEmpty())
|
||||
qmlWordsAlsoInJs << QLatin1String("default") << QLatin1String("function");
|
||||
static QStringList qmlWords{
|
||||
QLatin1String("property"),
|
||||
//QLatin1String("readonly")
|
||||
QLatin1String("signal"),
|
||||
QLatin1String("import")
|
||||
};
|
||||
static QStringList qmlWordsAlsoInJs{
|
||||
QLatin1String("default"), QLatin1String("function")
|
||||
};
|
||||
|
||||
addCompletions(&m_completions, qmlWords, m_interface->keywordIcon(), KeywordOrder);
|
||||
if (!doJsKeywordCompletion)
|
||||
|
||||
@@ -42,16 +42,10 @@ QmlJSHighlighter::QmlJSHighlighter(QTextDocument *parent)
|
||||
m_inMultilineComment(false)
|
||||
{
|
||||
m_currentBlockParentheses.reserve(20);
|
||||
static QVector<TextStyle> categories;
|
||||
if (categories.isEmpty()) {
|
||||
categories << C_NUMBER
|
||||
<< C_STRING
|
||||
<< C_TYPE
|
||||
<< C_KEYWORD
|
||||
<< C_FIELD
|
||||
<< C_COMMENT
|
||||
<< C_VISUAL_WHITESPACE;
|
||||
}
|
||||
static const QVector<TextStyle> categories{
|
||||
C_NUMBER, C_STRING, C_TYPE,
|
||||
C_KEYWORD, C_FIELD, C_COMMENT,
|
||||
C_VISUAL_WHITESPACE};
|
||||
setTextFormatCategories(categories);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user