| 169 | } |
| 170 | |
| 171 | QVariant CodeCompletionModel::data(const QModelIndex &index, int role) const |
| 172 | { |
| 173 | if (!index.isValid() || index.row() >= d->completionDatas.size()) |
| 174 | return QVariant(); |
| 175 | |
| 176 | const auto &item = d->completionDatas.at(index.row()); |
| 177 | switch (role) { |
| 178 | case NameRole: |
| 179 | return item.label; |
| 180 | case IconRole: |
| 181 | return d->iconForKind(item.kind); |
| 182 | case InsertTextRole: |
| 183 | return item.insertText; |
| 184 | case KindRole: |
| 185 | return item.kind; |
| 186 | case SortTextRole: |
| 187 | return item.sortText; |
| 188 | case FilterTextRole: |
| 189 | return item.filterText; |
| 190 | default: |
| 191 | break; |
| 192 | } |
| 193 | |
| 194 | return QVariant(); |
| 195 | } |
| 196 | |
| 197 | void CodeCompletionModel::onCompleteFinished(const lsp::CompletionProvider &provider) |
| 198 | { |
no test coverage detected