Skip to content

fix: correct command tab completion - #25

Merged
ryanbarlow97 merged 3 commits into
masterfrom
fix/command-tab-completion-20261015
Oct 15, 2026
Merged

ryanbarlow97 merged 3 commits into
masterfrom
fix/command-tab-completion-20261015

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Correct command suggestions to match the arguments accepted by CoreProtect, including the current prefix and applicable permission or sender context.

  • COREPROTECT-1: Added permission/context-aware teleport, give, preview apply/cancel and network-debug canonical roots for co/core/coreprotect.
  • COREPROTECT-2: Teleport/tp complete loaded worlds and existing wid IDs; coordinate positions return explicit empty results. Names containing spaces use an existing wid ID.
  • COREPROTECT-3: Console completion includes authorized commands and console-only consumer pause/resume; near requires a located player/command-block sender and either lookup execution permission.
  • COREPROTECT-4: Whitespace action values filter the current token and omit the already-entered marker; inline values retain their marker.
  • COREPROTECT-5: User/action/include/exclude comma lists preserve completed text and match the final value; whitespace user/material continuations return only the current replacement token. Rollback action lists stay unsupported.
  • COREPROTECT-6: Include/exclude values add valid entity types present in the identifier cache, and exclusions add online player names; purge excludes entity/player candidates.
  • COREPROTECT-7: Purge include values require purge permission rather than unrelated lookup/rollback/restore permission.
  • COREPROTECT-8: Purge completion tracks remaining time/radius/include parameters and #optimize across accepted aliases, argument orders and depths; unhandled positions return empty lists rather than blank-string candidates.
  • COREPROTECT-9: Parameter dispatch checks the selected command permission; action values match lookup subpermissions or rollback/restore capabilities, excluding purge actions and incompatible skill action lists.
  • COREPROTECT-10: Added reload help topic and deduplicated #silent/#verbose modifiers for lookup/rollback/restore, preserving current-token completion and restricting preview to supported player commands.

Validation: tfmc-mvn -o -B --no-transfer-progress clean verify passed (41 tests, zero failures/errors/skips), including command-completion regressions. Existing coverage gates and git diff --check passed.

Documentation: TF-Minecraft/Docs#266.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c93614c-e373-4d29-aa4b-40d16811591c
📥 Commits

Reviewing files that changed from the base of the PR and between bb99784 and 30d599a.

📒 Files selected for processing: 2
  • src/main/java/net/tfminecraft/coreprotect/command/TabHandler.java
  • src/test/java/net/tfminecraft/coreprotect/command/TabHandlerTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Improvements
    • Command suggestions now adapt to sender permissions, configuration and command type, including teleport and consumer subcommands.
    • Lookup, rollback, restore and purge completions better reflect supported actions, parameter order, preview state and repeated or list-based inputs.
    • Material suggestions include cached entity types, and online players are available for exclusions.
    • Unhandled or unavailable completions now return empty suggestions rather than placeholder values.

Tab completion now supports additional sender types, sender- and permission-dependent root suggestions, and command-specific argument suggestions. Parameter tracking handles modifiers and comma-separated values. Tests cover permissions, aliases, senders and argument forms.

Changes: Tab completion

Layer / File(s) Summary
Sender-aware entry and root suggestions
src/main/java/net/tfminecraft/coreprotect/command/TabHandler.java, src/test/java/net/tfminecraft/coreprotect/command/TabHandlerTest.java
The completion entry point handles non-player senders and returns empty lists when no suggestions apply. Root suggestions depend on sender type, permissions, configuration and rollback preview state. Tests cover root aliases, sender access and preview-dependent options.
Parameter tracking and command-specific modifiers
src/main/java/net/tfminecraft/coreprotect/command/TabHandler.java, src/test/java/net/tfminecraft/coreprotect/command/TabHandlerTest.java
Parameter tracking recognises verbose, silent and optimize modifiers. Lookup and purge suggestions account for command type, sender and parameters already present. Tests cover lookup aliases, permissions and modifier suggestions.
Action, world and value completions
src/main/java/net/tfminecraft/coreprotect/command/TabHandler.java, src/test/java/net/tfminecraft/coreprotect/command/TabHandlerTest.java
Action suggestions are filtered by command and permission. Teleport, page, radius, material and entity completions use prefix- and list-aware handling. Tests cover action filtering, world names, exclusions and comma-separated values.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 30d59

This change improves command tab completion to respect senders, permissions and arguments. No concrete merge-blocking risk was identified in the reviewed context.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:L 100-499 effective changed lines (tests excluded in mixed PRs). label Oct 15, 2026
@ryanbarlow97
ryanbarlow97 marked this pull request as ready for review October 15, 2026 18:44
@ryanbarlow97
ryanbarlow97 merged commit 9f147df into master Oct 15, 2026
4 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/command-tab-completion-20261015 branch October 15, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant