private TextFieldWithAutoCompletion<String> createTextFieldWithCompletion(String text, final List<String> variants) {
    final StringsCompletionProvider provider = new StringsCompletionProvider(variants, null) {
      @Nullable
      @Override
      public String getPrefix(@NotNull String text, int offset) {
        final int i = text.lastIndexOf('{', offset - 1);
        if (i < 0) {
          return "";
        }
        return text.substring(i, offset);
      }
    };
    return new TextFieldWithAutoCompletion<>(myProject, provider, true, text);
  }
private TextFieldWithAutoCompletion<String> createTextFieldWithCompletion(String text, final List<String> variants)