private static @NotNull String getCompletionPrefix(String text, int offset) {
    int i = text.lastIndexOf(' ', offset - 1) + 1;
    int j = text.lastIndexOf('\n', offset - 1) + 1;
    return text.substring(Math.max(i, j), offset);
  }
private static @NotNull String getCompletionPrefix(String text, int offset)