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

Allow to supply an optional prefix to single eval endpoint. #53

Open
Alathreon opened this issue Sep 10, 2024 · 1 comment
Open

Allow to supply an optional prefix to single eval endpoint. #53

Alathreon opened this issue Sep 10, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Alathreon
Copy link
Contributor

Alathreon commented Sep 10, 2024

The reason it doesn't take an id, is so it can't be called a second time.
But it's often hard to tell who used which single eval endpoint.
So allowing to supply a prefix would help tell who sent it.

Currently, the name of the session would be an uuid like 8ea0dc84-c4ce-4e20-8444-5c57d340c0cb.
But with this change, it could have an optional prefix in order to end up like this john_8ea0dc84-c4ce-4e20-8444-5c57d340c0cb

Implementation note : the prefix must be validated with a similar regex to JShellController#validateId(String), but shouldn't allow any underscore, so underscore can be used to separate the prefix to the uuid.

@Alathreon Alathreon added enhancement New feature or request good first issue Good for newcomers labels Sep 10, 2024
@andrew-09
Copy link

When is the single eval endpoint being triggered? Like what discord command triggers it?

I know the "/jshell eval code" discord command triggers the /eval endpoint. But it seems like jshell single eval doesn't have anything that triggers it?

The only way to trigger single eval (from what I understand) is by editing a message that had code, that was previously evaluated through the "/jshell eval code" command. But it deletes the original message after running that command, so we can't edit the original message; therefore jshell single-eval never gets triggered?

Its also not detecting my message as code when I don't use the /jshell command and I paste my code in

Am I missing something here?

image
For example in image above I can't edit my original message "jshell eval code: System.out.println("HELLO");"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants