Skip to content

fix: correct command tab completion - #21

Merged
ryanbarlow97 merged 1 commit into
mainfrom
fix/command-tab-completion-20261015
Oct 15, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
fix/command-tab-completion-20261015

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

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

  • DOW-01: Root commands, saved resource IDs and yield presets match the current token case-insensitively; exact command tokens stay in their root slot until a trailing space. Terminal arguments return explicit empty lists.
  • DOW-02: Resource type completion uses distinct loaded NodeType.getResource labels, preserving configured case and reflecting reloads. Removed usage placeholders; new IDs remain free text.
  • DOW-03: Authorized console senders can complete reload; create/delete descendants remain player-only.

Validation: tfmc-mvn -o -B --no-transfer-progress clean verify passed (222 tests, zero failures/errors; 0 skips), including command-completion regressions. 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: 8ef01617-4fcf-4dc0-99aa-2a08c15f6ff0
📥 Commits

Reviewing files that changed from the base of the PR and between 367b897 and e0ae192.

📒 Files selected for processing: 2
  • src/main/java/net/tfminecraft/dowsing/utils/TabCompletion.java
  • src/test/java/net/tfminecraft/dowsing/managers/CommandAndResourceTest.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

  • New Features
    • Command suggestions now include resource creation and deletion options, resource names, and valid yield values.
    • Suggestions are filtered by the text entered so far, with case-insensitive matching.
  • Bug Fixes
    • Unsupported commands and unavailable suggestions now return an empty list instead of no result.
    • Suggestions are limited to administrators; player-specific options are shown only to players.

Tab completion now filters suggestions by the current token, uses loaded node types for resource names, and returns empty lists when suggestions do not apply. Tests cover filtering, sender permissions, and resource suggestions.

Changes: Tab completion

Layer / File(s) Summary
Completion filtering and suggestions
src/main/java/net/tfminecraft/dowsing/utils/TabCompletion.java, src/test/java/net/tfminecraft/dowsing/managers/CommandAndResourceTest.java
The completion handler filters suggestions case-insensitively and applies command and sender restrictions. Resource creation suggests loaded resource names and yield values; resource deletion suggests IDs from .txt files. Tests cover these behaviours and empty results.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to e0ae1

Command suggestions align with accepted arguments and sender permissions; no merge-blocking issue was identified.

- [ ] 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:M 30-99 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 27af057 into main 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:M 30-99 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant