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

(a8cb8731c460845e95d4529de8abcfdc544c4a88)

+ Include dependency graph for qqmllscompletion.cpp:

Go to the source code of this file.

Functions

static bool testScopeSymbol (const QQmlJSScope::ConstPtr &scope, LocalSymbolsTypes options, CompletionItemKind kind)
 
template<typename F >
void collectFromAllJavaScriptParents (const F &&f, const QQmlJSScope::ConstPtr &scope)
 
static const QQmlJSScoperesolve (const QQmlJSScope *current, const QStringList &names)
 
static void collectLabels (const DomItem &context, QQmlLSCompletion::BackInsertIterator result)
 

Variables

static const QMap< QString, QList< QString > > valuesForPragmas
 Mapping from pragma names to allowed pragma values.
 

Function Documentation

◆ collectFromAllJavaScriptParents()

template<typename F >
void collectFromAllJavaScriptParents ( const F && f,
const QQmlJSScope::ConstPtr & scope )

Calls F on all JavaScript-parents of scope. For example, you can use this method to collect all the JavaScript Identifiers from following code:

{ // this block statement contains only 'x'
let x = 3;
{ // this block statement contains only 'y', and 'x' has to be retrieved via its parent.
let y = 4;
}
}
GLint GLint GLint GLint GLint x
[0]
GLint y

Definition at line 460 of file qqmllscompletion.cpp.

References QQmlJSScope::parentScope(), and QQmlSA::QMLScope.

+ Here is the call graph for this function:

◆ collectLabels()

static void collectLabels ( const DomItem & context,
QQmlLSCompletion::BackInsertIterator result )
static

Collect the current set of labels that some DomItem can jump to.

Definition at line 1499 of file qqmllscompletion.cpp.

References context, and item.

◆ resolve()

◆ testScopeSymbol()

static bool testScopeSymbol ( const QQmlJSScope::ConstPtr & scope,
LocalSymbolsTypes options,
CompletionItemKind kind )
static

Definition at line 262 of file qqmllscompletion.cpp.

References QQmlJSScope::attachedType(), QQmlJSScope::isCreatable(), QDeferredSharedPointer< T >::isNull(), QQmlJSScope::isReferenceType(), and QQmlJSScope::isSingleton().

+ Here is the call graph for this function:

Variable Documentation

◆ valuesForPragmas

const QMap<QString, QList<QString> > valuesForPragmas
static
Initial value:
{
{ u"ComponentBehavior"_s, { u"Unbound"_s, u"Bound"_s } },
{ u"NativeMethodBehavior"_s, { u"AcceptThisObject"_s, u"RejectThisObject"_s } },
{ u"ListPropertyAssignBehavior"_s, { u"Append"_s, u"Replace"_s, u"ReplaceIfNotDefault"_s } },
{ u"Singleton"_s, {} },
{ u"ValueTypeBehavior"_s, { u"Addressable"_s, u"Inaddressable"_s } },
}

Mapping from pragma names to allowed pragma values.

This mapping of pragma names to pragma values is not complete. In fact, it only contains the pragma names and values that one should see autocompletion for. Some pragmas like FunctionSignatureBehavior or Strict or the Reference/Value of ValueTypeBehavior, for example, should currently not be proposed as completion items by qmlls.

An empty QList-value in the QMap means that the pragma does not accept pragma values.

Definition at line 620 of file qqmllscompletion.cpp.