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
qqmllsutils.cpp File Reference

(0fd6c5969d9228fd891b26b8c4eebe125b4dd4b5)

#include "qqmllsutils_p.h"
#include <QtLanguageServer/private/qlanguageserverspectypes_p.h>
#include <QtCore/qthreadpool.h>
#include <QtCore/private/qduplicatetracker_p.h>
#include <QtCore/QRegularExpression>
#include <QtQmlDom/private/qqmldomexternalitems_p.h>
#include <QtQmlDom/private/qqmldomtop_p.h>
#include <QtQmlDom/private/qqmldomscriptelements_p.h>
#include <QtQmlDom/private/qqmldom_utils_p.h>
#include <QtQml/private/qqmlsignalnames_p.h>
#include <QtQml/private/qqmljslexer_p.h>
#include <QtQmlCompiler/private/qqmljsutils_p.h>
#include <algorithm>
#include <iterator>
#include <memory>
#include <optional>
#include <set>
#include <stack>
#include <type_traits>
#include <utility>
#include <variant>
+ Include dependency graph for qqmllsutils.cpp:

Go to the source code of this file.

Classes

struct  QQmlLSUtils::SignalOrProperty
 

Namespaces

namespace  QQmlLSUtils
 

Functions

QString QQmlLSUtils::qualifiersFrom (const DomItem &el)
 
bool QQmlLSUtils::isFieldMemberExpression (const DomItem &item)
 
bool QQmlLSUtils::isFieldMemberAccess (const DomItem &item)
 
QStringList QQmlLSUtils::fieldMemberExpressionBits (const DomItem &item, const DomItem &stopAtChild)
 
QByteArray QQmlLSUtils::lspUriToQmlUrl (const QByteArray &uri)
 
QByteArray QQmlLSUtils::qmlUrlToLspUri (const QByteArray &url)
 
QLspSpecification::Range QQmlLSUtils::qmlLocationToLspLocation (const QString &code, QQmlJS::SourceLocation qmlLocation)
 Converts a QQmlJS::SourceLocation to a LSP Range.
 
qsizetype QQmlLSUtils::textOffsetFrom (const QString &text, int row, int column)
 Convert a text position from (line, column) into an offset.
 
TextPosition QQmlLSUtils::textRowAndColumnFrom (const QString &text, qsizetype offset)
 Convert a text position from an offset into (line, column).
 
static QList< ItemLocation >::const_iterator QQmlLSUtils::handlePropertyDefinitionAndBindingOverlap (const QList< ItemLocation > &items, qsizetype offsetInFile)
 
static QList< ItemLocationQQmlLSUtils::filterItemsFromTextLocation (const QList< ItemLocation > &items, qsizetype offsetInFile)
 
QList< ItemLocationQQmlLSUtils::itemsFromTextLocation (const DomItem &file, int line, int character)
 Find the DomItem representing the object situated in file at given line and character/column.
 
DomItem QQmlLSUtils::baseObject (const DomItem &object)
 
static std::optional< LocationQQmlLSUtils::locationFromDomItem (const DomItem &item, FileLocationRegion region)
 
std::optional< LocationQQmlLSUtils::findTypeDefinitionOf (const DomItem &object)
 Returns the location of the type definition pointed by object.
 
static bool QQmlLSUtils::findDefinitionFromItem (const DomItem &item, const QString &name)
 
static DomItem QQmlLSUtils::findJSIdentifierDefinition (const DomItem &item, const QString &name)
 
static std::optional< SignalOrPropertyQQmlLSUtils::resolveNameInQmlScope (const QString &name, const QQmlJSScope::ConstPtr &owner)
 Find out if {name} is a signal, signal handler, property, property changed signal, or a property changed handler in the given QQmlJSScope.
 
static QStringList QQmlLSUtils::namesOfPossibleUsages (const QString &name, const DomItem &item, const QQmlJSScope::ConstPtr &targetType)
 
template<typename Predicate >
QQmlJSScope::ConstPtr QQmlLSUtils::findDefiningScopeIf (const QQmlJSScope::ConstPtr &referrerScope, Predicate &&check)
 
QQmlJSScope::ConstPtr QQmlLSUtils::findDefiningScopeForProperty (const QQmlJSScope::ConstPtr &referrerScope, const QString &nameToCheck)
 Finds the scope where a property is first defined.
 
QQmlJSScope::ConstPtr QQmlLSUtils::findDefiningScopeForBinding (const QQmlJSScope::ConstPtr &referrerScope, const QString &nameToCheck)
 
QQmlJSScope::ConstPtr QQmlLSUtils::findDefiningScopeForMethod (const QQmlJSScope::ConstPtr &referrerScope, const QString &nameToCheck)
 
QQmlJSScope::ConstPtr QQmlLSUtils::findDefiningScopeForEnumeration (const QQmlJSScope::ConstPtr &referrerScope, const QString &nameToCheck)
 
QQmlJSScope::ConstPtr QQmlLSUtils::findDefiningScopeForEnumerationKey (const QQmlJSScope::ConstPtr &referrerScope, const QString &nameToCheck)
 
static FieldFilter QQmlLSUtils::filterForFindUsages ()
 Filter away the parts of the Dom not needed for find usages, by following the profiler's information.
 
static void QQmlLSUtils::findUsagesOfNonJSIdentifiers (const DomItem &item, const QString &name, Usages &result)
 
static Location QQmlLSUtils::locationFromJSIdentifierDefinition (const DomItem &definitionOfItem, const QString &name)
 
static void QQmlLSUtils::findUsagesHelper (const DomItem &item, const QString &name, Usages &result)
 
Usages QQmlLSUtils::findUsagesOf (const DomItem &item)
 
static std::optional< IdentifierTypeQQmlLSUtils::hasMethodOrSignal (const QQmlJSScope::ConstPtr &scope, const QString &name)
 
static std::optional< ExpressionTypeQQmlLSUtils::methodFromReferrerScope (const QQmlJSScope::ConstPtr &referrerScope, const QString &name, ResolveOptions options)
 
static std::optional< ExpressionTypeQQmlLSUtils::propertyFromReferrerScope (const QQmlJSScope::ConstPtr &referrerScope, const QString &propertyName, ResolveOptions options)
 
static std::optional< ExpressionTypeQQmlLSUtils::propertyBindingFromReferrerScope (const QQmlJSScope::ConstPtr &referrerScope, const QString &name, ResolveOptions options, QQmlJSTypeResolver *resolverForIds)
 
static QQmlJSScope::ConstPtr QQmlLSUtils::findScopeOfSpecialItems (const QQmlJSScope::ConstPtr &scope, const DomItem &item)
 
static std::optional< ExpressionTypeQQmlLSUtils::resolveFieldMemberExpressionType (const DomItem &item, ResolveOptions options)
 
static std::optional< ExpressionTypeQQmlLSUtils::resolveIdentifierExpressionType (const DomItem &item, ResolveOptions options)
 
static std::optional< ExpressionTypeQQmlLSUtils::resolveSignalOrPropertyExpressionType (const QString &name, const QQmlJSScope::ConstPtr &scope, ResolveOptions options)
 
std::optional< ExpressionTypeQQmlLSUtils::resolveExpressionType (const QQmlJS::Dom::DomItem &item, ResolveOptions options)
 
DomItem QQmlLSUtils::sourceLocationToDomItem (const DomItem &file, const QQmlJS::SourceLocation &location)
 
static std::optional< LocationQQmlLSUtils::findMethodDefinitionOf (const DomItem &file, QQmlJS::SourceLocation location, const QString &name)
 
static std::optional< LocationQQmlLSUtils::findPropertyDefinitionOf (const DomItem &file, QQmlJS::SourceLocation propertyDefinitionLocation, const QString &name)
 
std::optional< LocationQQmlLSUtils::findDefinitionOf (const DomItem &item)
 
static QQmlJSScope::ConstPtr QQmlLSUtils::propertyOwnerFrom (const QQmlJSScope::ConstPtr &type, const QString &name)
 
static QQmlJSScope::ConstPtr QQmlLSUtils::methodOwnerFrom (const QQmlJSScope::ConstPtr &type, const QString &name)
 
static QQmlJSScope::ConstPtr QQmlLSUtils::expressionTypeWithDefinition (const ExpressionType &ownerType)
 
std::optional< ErrorMessageQQmlLSUtils::checkNameForRename (const DomItem &item, const QString &dirtyNewName, const std::optional< ExpressionType > &ownerType)
 
static std::optional< QStringQQmlLSUtils::oldNameFrom (const DomItem &item)
 
static std::optional< QStringQQmlLSUtils::newNameFrom (const QString &dirtyNewName, IdentifierType alternative)
 
RenameUsages QQmlLSUtils::renameUsagesOf (const DomItem &item, const QString &dirtyNewName, const std::optional< ExpressionType > &targetType)
 Rename the appearance of item to newName.
 
bool QQmlLSUtils::isValidEcmaScriptIdentifier (QStringView identifier)
 
QPair< QString, QStringListQQmlLSUtils::cmakeBuildCommand (const QString &path)