forked from qt-creator/qt-creator
QmlJS: Keep pragma directive when reformatting QML files
Change-Id: I1f11e95565a90e4fc7b908c03d49f6abbd37b8be Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
committed by
Marco Benelli
parent
52b34611dd
commit
11ef0db2fd
@@ -480,6 +480,13 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool visit(UiPragma *ast)
|
||||
{
|
||||
out("pragma ", ast->pragmaToken);
|
||||
accept(ast->pragmaType);
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool visit(UiImport *ast)
|
||||
{
|
||||
out("import ", ast->importToken);
|
||||
@@ -1187,6 +1194,12 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool visit(UiQualifiedPragmaId *ast)
|
||||
{
|
||||
out(ast->identifierToken);
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool visit(Elision *ast)
|
||||
{
|
||||
for (Elision *it = ast; it; it = it->next) {
|
||||
|
||||
6
tests/auto/qml/reformatter/qmlsingleton.qml
Normal file
6
tests/auto/qml/reformatter/qmlsingleton.qml
Normal file
@@ -0,0 +1,6 @@
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
}
|
||||
Reference in New Issue
Block a user