forked from qt-creator/qt-creator
qmljs: handle js directives .pragma and .import
The directives .pragma and .import are not included in the AST. Their source code locations are not stored in any other place. As a result, when reformatting the source, they simply disappear. This patch keep track of their source code locations, so they are not removed when reformatting the source code. This patch contains also some modification in the lexer that should probably be ported to the qtdeclarative version. Task-number: QTCREATORBUG-13038 Change-Id: I5d568abf02d37a584d4d246939736aaec5af5053 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -1312,7 +1312,7 @@ bool Lexer::scanDirectives(Directives *directives, DiagnosticMessage *error)
|
||||
}
|
||||
|
||||
// we found a .pragma library directive
|
||||
directives->pragmaLibrary();
|
||||
directives->pragmaLibrary(lineNumber, column);
|
||||
|
||||
} else {
|
||||
Q_ASSERT(directiveName == QLatin1String("import"));
|
||||
|
||||
Reference in New Issue
Block a user