QmlJS: Restrict warnings of blocks

Warn only if the block contains a var statement
as this is discouraged.

Fixes: QTCREATORBUG-24214
Change-Id: Ib96c6723e82b6ddce0b7b63f23d3408f45ae7d58
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Christian Stenger
2021-05-04 12:04:01 +02:00
parent 845afb25fc
commit 2447d1d69c
2 changed files with 21 additions and 1 deletions

View File

@@ -123,6 +123,7 @@ private:
bool isQtQuick2Ui() const;
bool isCaseOrDefault(AST::Node *n);
bool hasVarStatement(AST::Block *b) const;
AST::Node *parent(int distance = 0);