Skip to content

Conversation

@jvstinxz
Copy link
Contributor

Overview

Fixes #3028

Description

This PR fixes the incorrect tab completion behavior for the command /plot flag set <flag> <value>

Submitter Checklist

  • Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • Ensure that the pull request title represents the desired changelog entry.
  • New public fields and methods are annotated with @since TODO.
  • I read and followed the contribution guidelines.

@jvstinxz jvstinxz requested a review from a team as a code owner July 18, 2025 07:09
@github-actions github-actions bot added the Bugfix This PR fixes a bug label Jul 18, 2025
Copy link
Member

@PierreSchwang PierreSchwang left a comment

Choose a reason for hiding this comment

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

works

@PierreSchwang
Copy link
Member

the tabcompletion should probably get a small refactor - if you want to, you can adjust those small things:

  • don't call Arrays.asList for every tab completion (could be a Set which is initialized once - or compare constants directly)
  • potentially check args.length before comparing against the list (not sure if the JVM optimizes that either way)
  • the abbreviations don't seem to tab-complete (e.g. /p f set -> /p f s) - all possible abbreviations are listed on line 252

@jvstinxz
Copy link
Contributor Author

Still new to this so I just did the third suggestion, should be fine like that.

.map(value -> new Command(null, false, value, "", RequiredType.NONE, null) {
}).collect(Collectors.toList());
} else if (Arrays.asList("set", "add", "remove", "delete", "info")
} else if (Arrays.asList("set", "s", "add", "a", "remove", "r", "delete", "info", "i")
Copy link
Member

@dordsor21 dordsor21 Jul 25, 2025

Choose a reason for hiding this comment

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

Yeah I'd like to see these extracted to static final Collections.immutableSet at the class level - this would be best practices for Java. The args.length == # should be moved -- it is unlikely for these operations to be reordered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix This PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/plot f set <flag> <value> uses improper tab completions

3 participants