PlotSquared icon indicating copy to clipboard operation
PlotSquared copied to clipboard

fix: correct tab completion for `/plot flag set <flag> <value>`

Open jvstinxz opened this issue 5 months ago • 2 comments

Overview

Fixes #3028

Description

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

Submitter Checklist

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

jvstinxz avatar Jul 18 '25 07:07 jvstinxz

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

PierreSchwang avatar Jul 20 '25 21:07 PierreSchwang

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

jvstinxz avatar Jul 21 '25 00:07 jvstinxz