5#ifndef QQMLJSLINTERCODEGEN_P_H
6#define QQMLJSLINTERCODEGEN_P_H
24#include <private/qduplicatetracker_p.h>
25#include <private/qqmlirbuilder_p.h>
26#include <private/qqmljscompilepass_p.h>
27#include <private/qqmljscompiler_p.h>
28#include <private/qqmljscontextproperties_p.h>
29#include <private/qqmljsdiagnosticmessage_p.h>
30#include <private/qqmljslintercontext_p.h>
31#include <private/qqmljslintertypepropagator_p.h>
32#include <private/qqmljslogger_p.h>
33#include <private/qqmljsscope_p.h>
34#include <private/qqmljstypepropagator_p.h>
35#include <private/qqmljstyperesolver_p.h>
36#include <private/qqmljsusercontextproperties_p.h>
58 const QStringList &qmldirFiles, QQmlJSLogger *logger,
59 const QQmlJS::LinterContext &context);
61 void setDocument(
const QmlIR::JSCodeGen *codegen,
const QmlIR::Document *document)
override;
71 m_typeResolver = std::move(typeResolver);
81 QQmlSA::PassManager *m_passManager =
nullptr;
83 void analyzeFunction(
const QV4::Compiler::Context *context,
84 QQmlJSCompilePass::Function *function);
85 const QQmlJS::LinterContext &m_context;
86 QSet<IdMemberShadow> m_idMemberShadows;
void reportVarUsedBeforeDeclaration(const QString &name, const QString &fileName, QQmlJS::SourceLocation declarationLocation, QQmlJS::SourceLocation accessLocation) override
void reportFunctionUsedBeforeDeclaration(const QString &name, const QString &fileName, QQmlJS::SourceLocation declarationLocation, QQmlJS::SourceLocation accessLocation) override
UnreachableVisitor * unreachableVisitor() override
CodegenWarningInterface(QQmlJSLogger *logger)
bool visit(QQmlJS::AST::FunctionDeclaration *functionDeclaration) override
void throwRecursionDepthError() override
void setTypeResolver(QQmlJSTypeResolver typeResolver)
QQmlJSLinterCodegen(QQmlJSImporter *importer, const QString &fileName, const QStringList &qmldirFiles, QQmlJSLogger *logger, const QQmlJS::LinterContext &context)
QQmlSA::PassManager * passManager()
QQmlJSTypeResolver * typeResolver()
void setDocument(const QmlIR::JSCodeGen *codegen, const QmlIR::Document *document) override
void setPassManager(QQmlSA::PassManager *passManager)
const QList< QQmlJS::LoggerCategory > categories() const
Plugin(Plugin &&plugin) noexcept
Plugin(const QStaticPlugin &plugin)
const QString & name() const
const QString & version() const
const QString & author() const
void setEnabled(bool isEnabled)
const QString & description() const
Result lintModule(const QString &uri, LintOptions options, const QStringList &qmlImportPaths, const QStringList &resourceFiles)
void setPluginsEnabled(bool enablePlugins)
bool useAbsolutePath() const
Result lintFileInBatch(const QString &filename)
static std::vector< Plugin > loadPlugins(QStringList paths)
QQmlJSLinter(const QStringList &importPaths, const QStringList &extraPluginPaths={}, bool useAbsolutePath=false)
std::vector< Plugin > & plugins()
void setPlugins(std::vector< Plugin > plugins)
bool prepareFileForBatchLinting(const QString &filename, const QString *fileContents, LintOptions options, const QStringList &qmlImportPaths, const QStringList &qmldirFiles, const QStringList &resourceFiles, const QList< QQmlJS::LoggerCategory > &categories)
QQmlJSImporter m_importer
Q_DECLARE_FLAGS(LintOptions, LintOption)
static FixResult applyFixes(const QQmlJSLogger *logger, QString *fixedCode, bool silent)
bool pluginsEnabled() const
void postVisit(QQmlJS::AST::Node *) override
QSet< QString > * usedTypes() override
void addStaticImportWithLocation(const QString &name, const QQmlJS::SourceLocation &loc, bool isDependency) override
void handleLiteralBinding(const QQmlJSMetaPropertyBinding &binding, const AST::UiPublicMember *associatedPropertyDefinition) override
LinterVisitor(QQmlJSImporter *importer, QQmlJSLogger *logger, const QString &implicitImportDirectory, const QStringList &qmldirFiles=QStringList(), QQmlJS::Engine *engine=nullptr)
const QQmlJS::LinterRenamedComponents & renamedComponents() const
BindingExpressionParseResult parseBindingExpression(const QString &name, const QQmlJS::AST::Statement *statement, const QQmlJS::AST::UiPublicMember *associatedPropertyDefinition=nullptr) override
void addImportWithLocation(const QString &name, const QQmlJS::SourceLocation &loc, bool hadWarnings) override
void leaveEnvironment() override
bool safeInsertJSIdentifier(QQmlJSScope::Ptr &scope, const QString &name, const QQmlJSScope::JavaScriptIdentifier &identifier) override
bool visit(QQmlJS::AST::StringLiteral *) override
QQmlJS::AST::Node * astParentOfVisitedNode() const
void endVisit(QQmlJS::AST::FieldMemberExpression *fieldMember) override
bool preVisit(QQmlJS::AST::Node *) override
UnreachableVisitor(QQmlJSLogger *logger)
void throwRecursionDepthError() override
bool containsFunctionDeclaration(QQmlJS::AST::Node *node)
bool visit(QQmlJS::AST::StatementList *unreachable) override
Combined button and popup list for selecting options.
static void addJsonWarning(QJsonArray &warnings, const QQmlJS::DiagnosticMessage &message, QAnyStringView id, const std::optional< QQmlJSFixSuggestion > &suggestion={})
static void processMessages(const QQmlJSLogger &logger, QJsonArray &warnings)
bool operator==(const IdMemberShadow &lhs, const IdMemberShadow &rhs)
bool operator!=(const IdMemberShadow &lhs, const IdMemberShadow &rhs)
size_t qHash(const IdMemberShadow &idShadowsMember, size_t seed)
QQmlJSScope::ConstPtr memberOwnerScope
QQmlJSScope::ConstPtr idScope
void setStatusFromLogger()
std::unique_ptr< QQmlJSLogger > logger