Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompetiTestReceive enhancements #28

Closed
MuhammadSawalhy opened this issue Feb 2, 2023 · 7 comments · Fixed by #40
Closed

CompetiTestReceive enhancements #28

MuhammadSawalhy opened this issue Feb 2, 2023 · 7 comments · Fixed by #40

Comments

@MuhammadSawalhy
Copy link

I am so happy to see new features in this amazing NeoVim plugin. I found that CompetiTestReceive requires an argument and we can receive a problem or even a contest. But we need more work on this command.

I know that you are planning to add a custom template when a problem file is created and here are some features I really need.

1. Cancel fetching a contest or a problem

I was fetching a problem and wanted to exit the directory prompt by pressing Esc but it didn't work.

2. Default directory

We need more configuration to the custom directory for each online judge, I used to add problems in its own directory and inside its online judge directory. I saw some people also do this not only me. This is what my directories structure looks like:

├── <online judge>
    ├── <contest id>
        ├── <problem name>.cpp
    ├── <problem name>
            ├── main.cpp
@ayham-1
Copy link
Contributor

ayham-1 commented Feb 3, 2023

For template functionality, see #26.

And for default directory, I am currently working on that, see #27.

@xeluxee
Copy link
Owner

xeluxee commented Feb 3, 2023

I was fetching a problem and wanted to exit the directory prompt by pressing Esc but it didn't work.

<esc> is used to switch to normal mode. If you want to cancel fetching just press <C-c>.

We need more configuration to the custom directory for each online judge, I used to add problems in its own directory and inside its online judge directory. I saw some people also do this not only me.

@ayham-1 @MuhammadSawalhy what do you think about using special modifiers for contest directory?

contest_directory = "$(HOME)/path/to/contest/directory/$(JUDGE)/$(CONTEST)"

So users can customize directory structure to their likings.

@ayham-1
Copy link
Contributor

ayham-1 commented Feb 3, 2023

@xeluxee that is a good idea.

$(CONTEST) is already implemented in #29, using the competitive companion's group item.

Question is: how would $(JUDGE) be implemented?

@xeluxee
Copy link
Owner

xeluxee commented Feb 3, 2023

Question is: how would $(JUDGE) be implemented?

As README states:

group: Used to group problems together, which can be useful for archiving purposes. Follows the format <judge> - <category>, where the hyphen is discarded if the category is empty.

We can parse this string to take judge name and contest name. If <category> is empty we can substitute $(CONTEST) with a dummy string, like contest0, contest1...

@MuhammadSawalhy
Copy link
Author

MuhammadSawalhy commented Feb 3, 2023

We can parse this string to take judge name and contest name. If <category> is empty we can substitute $(CONTEST) with a dummy string, like contest0, contest1...

It is so confusing as we have a variety of choices here. So, it is better to make the default configuration contest<counter:0,1,...> or to make a custom contest identifier per judge such as contest id for Codeforces.

In addition to that we need to make the custom contest directory configuration a function that takes all these arguments (judge and contest information) and returns a string so the user can have whatever he wants.

We also need to have a custom function to configure the custom directory/name for problems.

@xeluxee
Copy link
Owner

xeluxee commented Feb 28, 2023

In addition to that we need to make the custom contest directory configuration a function that takes all these arguments (judge and contest information) and returns a string so the user can have whatever he wants.

We also need to have a custom function to configure the custom directory/name for problems.

Why do you need such a level of customization? Please provide an example.
I think modifiers like $(JUDGE) and $(CONTEST) are enough for most use-cases.

@MuhammadSawalhy
Copy link
Author

Why do you need such a level of customization? Please provide an example.
I think modifiers like $(JUDGE) and $(CONTEST) are enough for most use-cases.

All users have their own directory structure and almost each of them is different from the others. What will be the value of $(CONTEST)? Some may use the contest id and some may use the contest name.

I think it isn't that difficult to allow custom function configuration and let the user do whatever he wants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants