Changeset View
Changeset View
Standalone View
Standalone View
duchain/usebuilder.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 87 | { | |||
---|---|---|---|---|---|
90 | topContext()->addProblem(ptr); | 90 | topContext()->addProblem(ptr); | ||
91 | } | 91 | } | ||
92 | } | 92 | } | ||
93 | } | 93 | } | ||
94 | 94 | | |||
95 | if ( declaration && declaration->abstractType() && declaration->abstractType()->whichType() == AbstractType::TypeStructure ) { | 95 | if ( declaration && declaration->abstractType() && declaration->abstractType()->whichType() == AbstractType::TypeStructure ) { | ||
96 | if ( node->belongsToCall ) { | 96 | if ( node->belongsToCall ) { | ||
97 | DUChainReadLocker lock; | 97 | DUChainReadLocker lock; | ||
98 | QPair< Python::FunctionDeclarationPointer, bool > constructor = Helper:: | 98 | auto constructor = Helper::functionForCalled(declaration); | ||
99 | functionDeclarationForCalledDeclaration(DeclarationPointer(declaration)); | | |||
100 | lock.unlock(); | 99 | lock.unlock(); | ||
101 | bool isConstructor = constructor.second; | 100 | if ( constructor.isConstructor ) { | ||
102 | if ( isConstructor ) { | | |||
103 | RangeInRevision constructorRange; | 101 | RangeInRevision constructorRange; | ||
104 | // TODO fixme! this does not necessarily use the opening bracket as it should | 102 | // TODO fixme! this does not necessarily use the opening bracket as it should | ||
105 | constructorRange.start = CursorInRevision(node->endLine, node->endCol + 1); | 103 | constructorRange.start = CursorInRevision(node->endLine, node->endCol + 1); | ||
106 | constructorRange.end = CursorInRevision(node->endLine, node->endCol + 2); | 104 | constructorRange.end = CursorInRevision(node->endLine, node->endCol + 2); | ||
107 | UseBuilderBase::newUse(node, constructorRange, DeclarationPointer(constructor.first)); | 105 | UseBuilderBase::newUse(node, constructorRange, DeclarationPointer(constructor.declaration)); | ||
108 | } | 106 | } | ||
109 | } | 107 | } | ||
110 | } | 108 | } | ||
111 | 109 | | |||
112 | UseBuilderBase::newUse(node, useRange, DeclarationPointer(declaration)); | 110 | UseBuilderBase::newUse(node, useRange, DeclarationPointer(declaration)); | ||
113 | } | 111 | } | ||
114 | 112 | | |||
115 | void UseBuilder::visitAttribute(AttributeAst* node) | 113 | void UseBuilder::visitAttribute(AttributeAst* node) | ||
Show All 37 Lines |