Skip to content

Bytecode command #207

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

Closed
wants to merge 4 commits into from
Closed

Bytecode command #207

wants to merge 4 commits into from

Conversation

illuminator3
Copy link
Contributor

@illuminator3 illuminator3 commented Oct 19, 2021

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

  • Compiler subproject
  • PoC
  • 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 illuminator3 added enhancement New feature or request new command Add a new command or group of commands to the bot labels Oct 19, 2021
@illuminator3 illuminator3 self-assigned this Oct 19, 2021
@illuminator3 illuminator3 requested review from a team as code owners October 19, 2021 09:32
@Zabuzard
Copy link
Member

Not a slash command? Can you quickly elaborate why?

@Zabuzard
Copy link
Member

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

@illuminator3
Copy link
Contributor Author

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.

@Zabuzard Zabuzard added priority: normal and removed enhancement New feature or request labels Oct 19, 2021
@Zabuzard Zabuzard added this to the Improvement phase 1 milestone Oct 19, 2021
@illuminator3
Copy link
Contributor Author

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

@Zabuzard
Copy link
Member

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?

@illuminator3
Copy link
Contributor Author

illuminator3 commented Oct 19, 2021

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.

Copy link
Member

@Tais993 Tais993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

purgeMessagesById doesn't take a List because Java doesn't allow overloads by generics.
So if anyone was wondering why that design, that's why.

@illuminator3 illuminator3 enabled auto-merge (squash) November 12, 2021 15:45
illuminator3 and others added 3 commits November 17, 2022 11:50
* Initial commit of the bytecode command

* Fix sonar violations in BytecodeCommand.java

* I forgot to commit the changes in Application.java :pepega:

* Change module name from imc -> inmemorycompiler (Request from Zabuzard)

* Changed map name to something more self-explanatory (Request from Zabuzard)

* Make string constants static (Request from Zabuzard)

* Add comments explaining what certain parts do (Request from Zabuzard)

* Change parameter name from gevent -> genericEvent (Request from Zabuzard)

* Apply spotless

* Add error checking (Request from Zabuzard)

* Add comment (Request from Zabuzard)

* Unwrap asList invocation

* Added @NotNull annotations (Request from Zabuzard)

* Add error checking (Request from Zabuzard)

* Add @NotNull annotations (Request from Zabuzard)

* Change rex to e (Request from Zabuzard)

* Change toString -> getMessage (Request from Zabuzard)

* Use constant instead of a magic value (Request from Zabuzard)

* Add @NotNull annotation (Request from Zabuzard)

* Add @NotNull annotation (Request from Zabuzard)

* Change naming of parameters (Request from Zabuzard)

* Change method name from makeCollection -> iterToCollection (Request from Zabuzard)

* Improve map name (Request from Zabuzard)

* Add @NotNull annotation (Request from Zabuzard)

* Add @NotNull annotation (Request from Zabuzard)

* Remove cast

* Add @NotNull annotation (Request from Zabuzard)

* Add @NotNull annotation (Request from Zabuzard)

* Add javadoc (Request from Zabuzard)

* Add @NotNull annotation (Request from Zabuzard)

* Apply spotless

* Change parameter name

* Make use of TextChannel#purgeMessagesById (Request from Tijs)

* Pass initial capacity to ArrayList constructor (Request from Tijs)

* Use LongStream in combination with purgeMessagesById

* Forgot to remove the outdated code

* Follow naming convention for constants and add javadoc

* Use `ListenerAdapter` and dedicated event methods

* Map to string (+ spotless)

* Add the @NotNull annotation everywhere (Request from Zabuzard)

* Use array generator instead of creating a new array (Request from Zabuzard)

* Made requested changes

* Forgot NotNull's

* Apply spotless

* Add NotNull annotations

* Change field name

* Use already present constant

* Use isEmpty instead of checking for size == 0

* Expand javadoc

* Change method name

* Add comment

* Use already present classes to achieve the same thing

* Applied spotless

* Make daddy CodeQL happy OwO

* Put comment above return

* Clean up code

* Change public to private

* Don't declare fields on the same line

* Exclude reflection sonar rule

* Change array creation to object cast

* Rename method parameters

* Don't declare fields in the "same" line

* Move suppression of sonarcloud warning to class level

* Use method reference instead of creating a new array

* Apply spotless

* tijs is cute

* still had this in here from debugging

* make daddy sonarcloud happy

* oh spotless wasn't done yet while I was committing 💀

* it's the future baby

* lmao shit doesn't even compile

* fuck you spotless

* Update application/src/main/java/org/togetherjava/tjbot/commands/bytecode/BytecodeCommand.java

Co-authored-by: Tais993 <49957334+Tais993@users.noreply.github.com>

* jingle bells batman smells

* Revert "jingle bells batman smells"

This reverts commit b91b3a5.

* add syntax highlighting

* requested changes

* spotless

* Merge branch 'develop' into feature/bytecode-command

Co-authored-by: illuminator3 <hardt-j@web.de>
Co-authored-by: Tais993 <49957334+Tais993@users.noreply.github.com>
@Zabuzard Zabuzard force-pushed the feature/bytecode-command branch from c48c420 to 545c1a7 Compare November 17, 2022 10:50
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication


private static MessageEmbed createResponse(String content) {
// Rust highlighting looks decent for bytecode
CodeFence resultCodeFence = new CodeFence("rust", content);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe extract "rust" to a field?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@github-actions github-actions bot added the inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later label Nov 27, 2022
@github-actions github-actions bot closed this Nov 27, 2022
@Zabuzard Zabuzard added valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board. and removed stale inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later labels Nov 28, 2022
@Zabuzard
Copy link
Member

Im still on it.

@illuminator3
Copy link
Contributor Author

status-report-status-update

@Zabuzard
Copy link
Member

Zabuzard commented Jan 9, 2023

Realistically speaking, right now Im not planning to continue working on it in the near future.

@Zabuzard Zabuzard added stale and removed valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board. labels Mar 6, 2023
@github-actions github-actions bot added the inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later label Mar 12, 2023
@github-actions github-actions bot closed this Mar 12, 2023
@illuminator3 illuminator3 added valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board. and removed inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later labels Mar 12, 2023
@illuminator3 illuminator3 reopened this Mar 12, 2023
@github-actions github-actions bot removed the stale label Mar 13, 2023
@Zabuzard
Copy link
Member

why did u reopen it, are u planning to work on it right now? otherwise, just keep it closed (it wont be deleted)

@ankitsmt211 ankitsmt211 added inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later and removed valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board. labels May 18, 2024
@ankitsmt211
Copy link
Member

This PR is being closed due to inactivity, can be opened later if need be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later new command Add a new command or group of commands to the bot priority: normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants