| 390 | c += ch |
| 391 | |
| 392 | var found = allText.substring(0, c).indexOfLast { |
| 393 | it.isWhitespace() |
| 394 | } |
| 395 | val prefix = allText.substring(found + 1, c) |
| 396 | |
| 397 | val possible = JavaSupport.javaSupport.getPossibleJavaClassesFor(prefix) |
| 398 | |
| 399 | val r = mutableListOf<Completion>() |
| 400 | for (p in possible) { |
| 401 | val tail = Math.max(p.first.lastIndexOf("."), p.first.lastIndexOf("$")) |
| 402 | val ex = Completion( |
| 403 | c - prefix.length, c, p.first.substring( |
| 404 | tail + |
| 405 | 1 |
| 406 | ), p.second |
| 407 | ) |
| 408 | var typeName = p.first.replace("\\$".toRegex(), ".") |
| 409 | if (typeName.endsWith(".")) typeName = typeName.substring(0, typeName.length - 1) |
| 410 | // ex.header = ("var " + p.first.substring(tail + 1) + " = Java.type('" + typeName |
| 411 | // + "')") |
| 412 | ex.header = "import ${typeName}" |
| 413 | r.add(ex) |
| 414 | } |
| 415 | |
| 416 | results.accept(r) |
| 417 |
nothing calls this directly
no test coverage detected