TJ-Bot icon indicating copy to clipboard operation
TJ-Bot copied to clipboard

Bytecode command

Open illuminator3 opened this issue 4 years ago • 51 comments
trafficstars

Adds a code action that allows viewing the bytecode of Java code. The code has to compile for this to work.

success

errors

no class

no java

Checklist

  • [x] Compiler subproject
  • [x] PoC
  • [x] command as code action
  • [ ] polish compiler subproject
  • [ ] javadoc
  • [ ] logging
  • [ ] a unit test to at least trigger the runtime-based code flow
  • [ ] UX enhancements for snippets and classes with other names

illuminator3 avatar Oct 19 '21 09:10 illuminator3

Not a slash command? Can you quickly elaborate why?

Zabuzard avatar Oct 19 '21 09:10 Zabuzard

Can you also show a quick example picture of a dialog, so that we can see the resulting message?

Zabuzard avatar Oct 19 '21 09:10 Zabuzard

Not a slash command? Can you quickly elaborate why?

Slashcommands do not yet support multiline messages. Therefore, we have to use "regular" commands for now since multiline support is basically required for code blocks.

illuminator3 avatar Oct 19 '21 09:10 illuminator3

Can you also show a quick example picture of a dialog, so that we can see the resulting message?

An example interaction: https://streamable.com/o2mpcw

illuminator3 avatar Oct 19 '21 09:10 illuminator3

Not a slash command? Can you quickly elaborate why?

Slashcommands do not yet support multiline messages. Therefore, we have to use "regular" commands for now since multiline support is basically required for code blocks.

Makes sense. What about the "message-id" feature you created for the tag system. I found that pretty cool. Maybe we just use that and then go slash command?

Zabuzard avatar Oct 19 '21 09:10 Zabuzard

Not a slash command? Can you quickly elaborate why?

Slashcommands do not yet support multiline messages. Therefore, we have to use "regular" commands for now since multiline support is basically required for code blocks.

Makes sense. What about the "message-id" feature you created for the tag system. I found that pretty cool. Maybe we just use that and then go slash command?

Imo it'd be pretty annoying to have to do that every time and would also cause issues with the current auto-update editing-system. Once slashcommands support multilines we can use them though.

illuminator3 avatar Oct 19 '21 09:10 illuminator3

Can you give a rough overview of how the command works under the hood? I.e. a technical explanation? What tools does it use, what is the flow etc?

Btw, sonar fails. Looks minor though.

Zabuzard avatar Nov 25 '21 07:11 Zabuzard

The checks fail. Please run spotless

RealYusufIsmail avatar Dec 01 '21 07:12 RealYusufIsmail

There is 2 bugs that need to be fix other than that all good. I might fix them.

RealYusufIsmail avatar Dec 03 '21 07:12 RealYusufIsmail

Should fix SonarCloud error

I might fix them.

@RealYusufIsmail Please do not just commit to branches of others. This is abuse of your permissions. Thank you for trying to help but the way you handled this was very disruptive and disturbing, causing merge conflicts and confusion on @illuminator3 side. For example, if he already had uncommited local changes, maybe he even already fixed the issues you mentioned locally.

If you want to contribute to the PR of someone else, here are the options:

  • kindly ask them if you can do this together, wait for a response and then coordinate
  • suggest changes to the PR via GitHubs code review UI, the author can then approve or dismiss them
  • suggest changes to the branch the PR is based on via another PR (a "PR to a PR"), illu can then approve or dismiss them
  • all of those require that the author approves and responds. in case the author is inactive, contact someone else (like me) for replanning the feature - i.e. unassigning the original author and assigning you, then it would be your PR

Zabuzard avatar Dec 03 '21 08:12 Zabuzard

@illuminator3 I was thinking. What was the reason again that this is not a slash command? Just the fact that you can reply to a message for nicer/faster UX?

If that is the case, I actually vote for going a slash command instead, which takes the message id (similar to the tag commands). I know that the UX is then a little bit more cumbersome (right click > copy message id, instead of right click > reply) but I do see more value in having the extra visibility and discoverability that slash commands provide.

This command naturally wont be used often, hence I think it is important that people can easily "discover" it by browsing the available slash command list, instead of just remembering a "magic command" which is only used rarely.

Zabuzard avatar Dec 03 '21 08:12 Zabuzard

No. It's terrible UX.

illuminator3 avatar Dec 09 '21 17:12 illuminator3

No. It's terrible UX.

I just hate that ur introducing the first and maybe also only command that is not a slashcommand 😬 Its so against the streamlined concept we created until now haha.

I can accept it but I dont like it, @marko-radosavljevic whats your opinion here?

Zabuzard avatar Dec 09 '21 18:12 Zabuzard

we already have the /tag-manage which takes a message id

wouldnt that work perfectly for this and reusing code and it was even written by illum

borgrel avatar Dec 09 '21 19:12 borgrel

No. Like I said already, it's terrible UX.

illuminator3 avatar Dec 09 '21 19:12 illuminator3

@Zabuzard

Yeah, it's also not something we often use, doing 2 clicks with mouse once in a while is not that terrible, to keep the consistency with literary every other command we have.

Introducing inconsistencies like this is also a bad UX, because we once again we have a problem we are currently trying to eliminate. Oh, is it ?command or !command or >command, how to use it… etc.

If we had more features that don't work well with slash commands, and it's something we need and frequently use, would make more sense imo, currently not so much.

So I guess I'm also in the camp 'I can accept it, but don't like it'. And since most of us agree on it, it's probably the approach we should take. ^^

marko-radosavljevic avatar Dec 09 '21 19:12 marko-radosavljevic

This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jan 14 '22 07:01 github-actions[bot]

bump

illuminator3 avatar Jan 27 '22 19:01 illuminator3

bump

Sorry, are you waiting for something? Iirc we wanted to have it changed to slashcommand and then it can be merged, I guess. CR of the code itself is pretty much through already.

Zabuzard avatar Jan 28 '22 08:01 Zabuzard

The main feature of this command (editing already existing "command usages") requires it to be a non-slash command. Even if Discord would release multi-line slash commands, this feature would not be possible to implement.

illuminator3 avatar Feb 11 '22 15:02 illuminator3

this feature would not be possible to implement.

I dont quite follow. Whats the difference between

!bytecode <code> and !bytecode message-id:123456 where message 123456 contains <code>

other than pure UX? Functionality-wise it would work the same.

Zabuzard avatar Feb 11 '22 15:02 Zabuzard

This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

github-actions[bot] avatar Mar 14 '22 07:03 github-actions[bot]

@illuminator3 are you fine with using message context-menus? Once our project finally updates.

Tais993 avatar Mar 14 '22 07:03 Tais993

@illuminator3 are you fine with using message context-menus? Once our project finally updates.

that's the preferred solution. I was originally going to use that but JDA didn't support it at the time of making this

mention me again (cuz I receive mobile push notifs) once we have support for context menus

illuminator3 avatar Mar 14 '22 18:03 illuminator3

Then we've to wait till JDA 5 released, will be a few months unfortunately. Unless we agree unto using the stable alpha builds.

Tais993 avatar Mar 14 '22 19:03 Tais993

This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

github-actions[bot] avatar Apr 14 '22 07:04 github-actions[bot]

This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

github-actions[bot] avatar May 15 '22 07:05 github-actions[bot]

@Tais993 any update on when we'll be getting context menus?

illuminator3 avatar May 31 '22 18:05 illuminator3

Waiting for #382, but currently too busy with internship. Will be finished in 3 weeks, so hopefully I've more free time then, alternatively someone else deals with it.

Only has to be merged really, #368 can be finished another time I guess

Tais993 avatar May 31 '22 18:05 Tais993