![]() |
Qt 6.x
The Qt SDK
|
#include <qqmljslinter_p.h>
Classes | |
class | Plugin |
Public Types | |
enum | LintResult { FailedToOpen , FailedToParse , HasWarnings , LintSuccess } |
enum | FixResult { NothingToFix , FixError , FixSuccess } |
Public Member Functions | |
QQmlJSLinter (const QStringList &importPaths, const QStringList &pluginPaths={ QQmlJSLinter::defaultPluginPath() }, bool useAbsolutePath=false) | |
LintResult | lintFile (const QString &filename, const QString *fileContents, const bool silent, QJsonArray *json, const QStringList &qmlImportPaths, const QStringList &qmldirFiles, const QStringList &resourceFiles, const QList< QQmlJS::LoggerCategory > &categories) |
LintResult | lintModule (const QString &uri, const bool silent, QJsonArray *json, const QStringList &qmlImportPaths, const QStringList &resourceFiles) |
FixResult | applyFixes (QString *fixedCode, bool silent) |
const QQmlJSLogger * | logger () const |
std::vector< Plugin > & | plugins () |
void | setPlugins (std::vector< Plugin > plugins) |
void | setPluginsEnabled (bool enablePlugins) |
bool | pluginsEnabled () const |
void | clearCache () |
Static Public Member Functions | |
static std::vector< Plugin > | loadPlugins (QStringList paths) |
static QString | defaultPluginPath () |
Definition at line 41 of file qqmljslinter_p.h.
Enumerator | |
---|---|
NothingToFix | |
FixError | |
FixSuccess |
Definition at line 49 of file qqmljslinter_p.h.
Enumerator | |
---|---|
FailedToOpen | |
FailedToParse | |
HasWarnings | |
LintSuccess |
Definition at line 48 of file qqmljslinter_p.h.
QQmlJSLinter::QQmlJSLinter | ( | const QStringList & | importPaths, |
const QStringList & | pluginPaths = { QQmlJSLinter::defaultPluginPath() } , |
||
bool | useAbsolutePath = false |
||
) |
Definition at line 68 of file qqmljslinter.cpp.
References loadPlugins().
QQmlJSLinter::FixResult QQmlJSLinter::applyFixes | ( | QString * | fixedCode, |
bool | silent | ||
) |
Definition at line 786 of file qqmljslinter.cpp.
References QFileInfo::absoluteFilePath(), QString::arg(), QList< T >::begin(), QList< T >::end(), engine, QQmlJSLogger::errors(), QQmlJSLogger::fileName(), FixError, FixSuccess, QString::fromLatin1(), info, QQmlJSLogger::infos(), QString::isEmpty(), QList< T >::isEmpty(), it, QString::left(), QQmlJS::SourceLocation::length, QString::mid(), NothingToFix, QQmlJS::SourceLocation::offset, Q_ASSERT, qDebug, qWarning, QQmlJS::Lexer::setCode(), QString::size(), QFileInfo::suffix(), QString::toLower(), QList< T >::value(), and QQmlJSLogger::warnings().
|
inline |
Definition at line 132 of file qqmljslinter_p.h.
|
static |
Definition at line 63 of file qqmljslinter.cpp.
References QLibraryInfo::path(), QLibraryInfo::PluginsPath, and QDir::separator().
QQmlJSLinter::LintResult QQmlJSLinter::lintFile | ( | const QString & | filename, |
const QString * | fileContents, | ||
const bool | silent, | ||
QJsonArray * | json, | ||
const QStringList & | qmlImportPaths, | ||
const QStringList & | qmldirFiles, | ||
const QStringList & | resourceFiles, | ||
const QList< QQmlJS::LoggerCategory > & | categories | ||
) |
Definition at line 416 of file qqmljslinter.cpp.
References QFileInfo::absoluteFilePath(), addJsonWarning(), QJsonArray::append(), QString::arg(), category(), QSet< T >::cbegin(), QSet< T >::cend(), QFileDevice::close(), QQmlJSScope::create(), QQmlJSScope::createQQmlSAElement(), QQmlJSTypeResolver::DoNotCloneTypes, engine, QFileDevice::error(), error, QIODevice::errorString(), FailedToOpen, FailedToParse, file, QQmlJSLogger::fileName(), QString::fromLatin1(), QString::fromUtf8(), QScopedPointer< T, Cleanup >::get(), QQmlJS::LoggerCategoryPrivate::get(), QQmlJS::LoggerCategoryPrivate::hasChanged(), QQmlJSLogger::hasErrors(), HasWarnings, QQmlJSLogger::hasWarnings(), QQmlJSImportVisitor::implicitImportDirectory(), QQmlJSImporter::importPaths(), info, QQmlJSTypeResolver::init(), interface, QList< T >::isEmpty(), it, LintSuccess, QQmlJSResourceFileMapper::localFileFilter(), QQmlJSLogger::log(), logger(), mapper, QQmlJS::LoggerWarningId::name(), QFile::open(), QQmlJSLogger::processMessages(), Q_ASSERT, qCompileQmlFile(), qmlImport, qmlSyntax, QStringLiteral, QtCriticalMsg, qWarning, QIODevice::readAll(), QIODeviceBase::ReadOnly, QQmlJSLogger::registerCategory(), QQmlSA::LintPlugin::registerPasses(), QScopedPointer< T, Cleanup >::reset(), QQmlJSLiteralBindingCheck::run(), QQmlJSLogger::setCategoryIgnored(), QQmlJSLogger::setCategoryLevel(), QQmlJSTypeResolver::setCloneMode(), QQmlJSLogger::setCode(), QQmlJS::Lexer::setCode(), QQmlJSLogger::setFileName(), QLoggingCategory::setFilterRules(), QQmlJSImporter::setImportPaths(), QQmlJSTypeResolver::setParentMode(), QQmlJSImporter::setResourceFileMapper(), QQmlJSLogger::setSilent(), QFileInfo::suffix(), QQmlJSImporter::takeGlobalWarnings(), QString::toLower(), and QQmlJSTypeResolver::UseDocumentParent.
Referenced by QmlLsp::QmlLintSuggestions::diagnose().
QQmlJSLinter::LintResult QQmlJSLinter::lintModule | ( | const QString & | uri, |
const bool | silent, | ||
QJsonArray * | json, | ||
const QStringList & | qmlImportPaths, | ||
const QStringList & | resourceFiles | ||
) |
Definition at line 624 of file qqmljslinter.cpp.
References QJsonArray::append(), QString::arg(), QMap< Key, T >::asKeyValueRange(), QQmlJSScope::attachedType(), QQmlJSImporter::clearCache(), QMap< Key, T >::contains(), QQmlJSLogger::hasErrors(), HasWarnings, QQmlJSLogger::hasWarnings(), i, QQmlJSImporter::importModule(), QQmlJSImporter::importPaths(), QQmlJSScope::internalName(), QList< T >::isEmpty(), QQmlJSScope::isFullyResolved(), QDeferredSharedPointer< T >::isNull(), LintSuccess, QQmlJSLogger::log(), mapper, method, QQmlJSScope::ownMethods(), QQmlJSScope::ownProperties(), QQmlJSLogger::processMessages(), property, qmlImport, qmlUnresolvedType, QStringLiteral, QScopedPointer< T, Cleanup >::reset(), QQmlJSLogger::setCode(), QQmlJSLogger::setFileName(), QQmlJSImporter::setImportPaths(), QQmlJSImporter::setResourceFileMapper(), QQmlJSLogger::setSilent(), QString::size(), QQmlJSScope::sourceLocation(), QQmlJSImporter::takeGlobalWarnings(), QQmlJSImporter::takeWarnings(), and typeName.
|
static |
Definition at line 196 of file qqmljslinter.cpp.
References QDuplicateTracker< T, Prealloc >::hasSeen(), QLibrary::isLibrary(), it, plugins(), qWarning, and QPluginLoader::staticPlugins().
Referenced by QQmlJSLinter().
|
inline |
Definition at line 121 of file qqmljslinter_p.h.
Referenced by QmlLsp::QmlLintSuggestions::diagnose(), and lintFile().
|
inline |
Definition at line 123 of file qqmljslinter_p.h.
Referenced by loadPlugins().
|
inline |
Definition at line 130 of file qqmljslinter_p.h.
Definition at line 127 of file qqmljslinter_p.h.
|
inline |
Definition at line 129 of file qqmljslinter_p.h.