Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQmlJSLinter Class Reference

#include <qqmljslinter_p.h>

+ Collaboration diagram for QQmlJSLinter:

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 QQmlJSLoggerlogger () 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< PluginloadPlugins (QStringList paths)
 
static QString defaultPluginPath ()
 

Detailed Description

Definition at line 41 of file qqmljslinter_p.h.

Member Enumeration Documentation

◆ FixResult

Enumerator
NothingToFix 
FixError 
FixSuccess 

Definition at line 49 of file qqmljslinter_p.h.

◆ LintResult

Enumerator
FailedToOpen 
FailedToParse 
HasWarnings 
LintSuccess 

Definition at line 48 of file qqmljslinter_p.h.

Constructor & Destructor Documentation

◆ QQmlJSLinter()

QQmlJSLinter::QQmlJSLinter ( const QStringList & importPaths,
const QStringList & pluginPaths = QQmlJSLinter::defaultPluginPath() },
bool useAbsolutePath = false )

Definition at line 68 of file qqmljslinter.cpp.

References loadPlugins().

+ Here is the call graph for this function:

Member Function Documentation

◆ applyFixes()

QQmlJSLinter::FixResult QQmlJSLinter::applyFixes ( QString * fixedCode,
bool silent )

◆ clearCache()

void QQmlJSLinter::clearCache ( )
inline

Definition at line 132 of file qqmljslinter_p.h.

◆ defaultPluginPath()

QString QQmlJSLinter::defaultPluginPath ( )
static

Definition at line 63 of file qqmljslinter.cpp.

References QLibraryInfo::path(), QLibraryInfo::PluginsPath, and QDir::separator().

+ Here is the call graph for this function:

◆ lintFile()

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 420 of file qqmljslinter.cpp.

References QFileInfo::absoluteFilePath(), addJsonWarning(), QJsonArray::append(), category(), QSet< T >::cbegin(), QSet< T >::cend(), QFileDevice::close(), QQmlJSScope::create(), QQmlSA::PassManagerPrivate::createPassManager(), QQmlJSScope::createQQmlSAElement(), QQmlSA::PassManagerPrivate::deletePassManager(), QQmlJSTypeResolver::DoNotCloneTypes, engine, QFileDevice::error(), error, QIODevice::errorString(), FailedToOpen, FailedToParse, file, QQmlJSLogger::fileName(), QString::fromLatin1(), QString::fromUtf8(), QScopedPointer< T, Cleanup >::get(), QQmlJS::LoggerCategoryPrivate::get(), QQmlJSLogger::hasErrors(), HasWarnings, QQmlJSLogger::hasWarnings(), QQmlJSImportVisitor::implicitImportDirectory(), QQmlJSImporter::importPaths(), info, QQmlJSTypeResolver::init(), interface, it, LintSuccess, QQmlJSResourceFileMapper::localFileFilter(), QQmlJSLogger::log(), logger(), mapper, QQmlSA::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(), QQmlJSLogger::setCategoryIgnored(), QQmlJSLogger::setCategoryLevel(), QQmlJSTypeResolver::setCloneMode(), QQmlJSLogger::setCode(), QQmlJS::Lexer::setCode(), QQmlJSLogger::setFileName(), QLoggingCategory::setFilterRules(), QQmlJSImporter::setImportPaths(), QQmlJSTypeResolver::setParentMode(), QQmlJSImporter::setResourceFileMapper(), QQmlJSLogger::setSilent(), QQmlJSImporter::takeGlobalWarnings(), and QQmlJSTypeResolver::UseDocumentParent.

+ Here is the call graph for this function:

◆ lintModule()

◆ loadPlugins()

std::vector< QQmlJSLinter::Plugin > QQmlJSLinter::loadPlugins ( QStringList paths)
static

Definition at line 200 of file qqmljslinter.cpp.

References QLibrary::isLibrary(), it, plugins(), Q_UNUSED, qWarning, and QPluginLoader::staticPlugins().

Referenced by QQmlJSLinter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logger()

const QQmlJSLogger * QQmlJSLinter::logger ( ) const
inline

Definition at line 121 of file qqmljslinter_p.h.

Referenced by lintFile().

+ Here is the caller graph for this function:

◆ plugins()

std::vector< Plugin > & QQmlJSLinter::plugins ( )
inline

Definition at line 123 of file qqmljslinter_p.h.

Referenced by loadPlugins().

+ Here is the caller graph for this function:

◆ pluginsEnabled()

bool QQmlJSLinter::pluginsEnabled ( ) const
inline

Definition at line 130 of file qqmljslinter_p.h.

◆ setPlugins()

void QQmlJSLinter::setPlugins ( std::vector< Plugin > plugins)
inline

Definition at line 127 of file qqmljslinter_p.h.

◆ setPluginsEnabled()

void QQmlJSLinter::setPluginsEnabled ( bool enablePlugins)
inline

Definition at line 129 of file qqmljslinter_p.h.


The documentation for this class was generated from the following files: