| 96 | } |
| 97 | |
| 98 | void 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 | } |
nothing calls this directly
no test coverage detected