(result)
| 165 | return cr |
| 166 | |
| 167 | def formatResult(result): |
| 168 | completion = dict() |
| 169 | |
| 170 | abbr = getAbbr(result.string) |
| 171 | word = filter(lambda x: not x.isKindInformative() and not x.isKindResultType(), result.string) |
| 172 | |
| 173 | args_pos = [] |
| 174 | cur_pos = 0 |
| 175 | for chunk in word: |
| 176 | chunk_len = len(chunk.spelling) |
| 177 | if chunk.isKindPlaceHolder(): |
| 178 | args_pos += [[ cur_pos, cur_pos + chunk_len ]] |
| 179 | cur_pos += chunk_len |
| 180 | |
| 181 | word = "".join(map(lambda x: x.spelling, word)) |
| 182 | |
| 183 | completion['word'] = word |
| 184 | completion['abbr'] = abbr |
| 185 | completion['menu'] = word |
| 186 | completion['info'] = word |
| 187 | completion['args_pos'] = args_pos |
| 188 | completion['dup'] = 0 |
| 189 | |
| 190 | # Replace the number that represents a specific kind with a better |
| 191 | # textual representation. |
| 192 | completion['kind'] = kinds[result.cursorKind] |
| 193 | |
| 194 | return completion |
| 195 | |
| 196 | |
| 197 | class CompleteThread(threading.Thread): |
nothing calls this directly
no test coverage detected