QmlJS: Handle inner ids in 'Wrap in Loader' quick fix.

Change-Id: I7385f49928db78abd2deb7783ca0a38288ae7446
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2011-11-04 13:59:23 +01:00
parent 13c3736832
commit de6ea6c3b9
3 changed files with 62 additions and 6 deletions

View File

@@ -29,12 +29,17 @@ QMLJS_EXPORT bool isValidBuiltinPropertyType(const QString &name);
QMLJS_EXPORT DiagnosticMessage errorMessage(const AST::SourceLocation &loc,
const QString &message);
template <class T>
AST::SourceLocation locationFromRange(const T *node)
{
return locationFromRange(node->firstSourceLocation(), node->lastSourceLocation());
}
template <class T>
DiagnosticMessage errorMessage(const T *node, const QString &message)
{
return DiagnosticMessage(DiagnosticMessage::Error,
locationFromRange(node->firstSourceLocation(),
node->lastSourceLocation()),
locationFromRange(node),
message);
}