| 137 | } |
| 138 | |
| 139 | void ClassBrowserPlugin::showDefinition(const DeclarationPointer& declaration) |
| 140 | { |
| 141 | DUChainReadLocker readLock(DUChain::lock()); |
| 142 | |
| 143 | if (!declaration) |
| 144 | return; |
| 145 | |
| 146 | Declaration* decl = declaration.data(); |
| 147 | // If it's a function, find the function definition to go to the actual declaration. |
| 148 | if (decl && decl->isFunctionDeclaration()) { |
| 149 | if (auto* funcDefinition = FunctionDefinition::definition(decl)) |
| 150 | decl = funcDefinition; |
| 151 | } |
| 152 | |
| 153 | if (decl) { |
| 154 | QUrl url = decl->url().toUrl(); |
| 155 | KTextEditor::Range range = decl->rangeInCurrentRevision(); |
| 156 | |
| 157 | readLock.unlock(); |
| 158 | |
| 159 | ICore::self()->documentController()->openDocument(url, range.start()); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | #include "classbrowserplugin.moc" |
| 164 | #include "moc_classbrowserplugin.cpp" |
no test coverage detected