| 200 | } |
| 201 | |
| 202 | void SymbolView::selectSymbol(const QString &symbol, int line, int col) |
| 203 | { |
| 204 | const auto &itemList = d->symbolModel.findItems(symbol, Qt::MatchExactly | Qt::MatchRecursive); |
| 205 | if (itemList.isEmpty()) |
| 206 | return; |
| 207 | |
| 208 | auto iter = std::find_if(itemList.crbegin(), itemList.crend(), |
| 209 | [&](QStandardItem *item) { |
| 210 | const auto &range = item->data(SymbolRangeRole).value<newlsp::Range>(); |
| 211 | return range.contains({ line, col }); |
| 212 | }); |
| 213 | |
| 214 | if (iter != itemList.crend()) { |
| 215 | const auto &index = d->symbolModel.indexFromItem(*iter); |
| 216 | d->select(index); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | void SymbolView::expandAll() |
| 221 | { |
no test coverage detected