MCPcopy Create free account
hub / github.com/KDE/kdevelop / useForExpression

Method useForExpression

plugins/qmljs/duchain/usebuilder.cpp:98–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void UseBuilder::useForExpression(QmlJS::AST::Node* node, const KDevelop::RangeInRevision &range)
99{
100 // ExpressionVisitor can find the type and corresponding declaration of many
101 // kinds of expressions (identifiers, field members, special identifiers like
102 // this or parent, etc).
103 ExpressionVisitor visitor(currentContext());
104
105 node->accept(&visitor);
106
107 if (visitor.lastDeclaration()) {
108 newUse(
109 range.isValid() ? range : m_session->locationsToRange(
110 node->firstSourceLocation(),
111 node->lastSourceLocation()
112 ),
113 visitor.lastDeclaration()
114 );
115 }
116}

Callers

nothing calls this directly

Calls 3

locationsToRangeMethod · 0.80
acceptMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected