Skip to content
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

Allow returning ? extends Suggestion or ? extends Iterable<? extends Suggestion>> from suggestion providers #690

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

jpenilla
Copy link
Member

@jpenilla jpenilla commented Feb 20, 2024

Removes the need for casting:

  @Override
  public Iterable<Suggestion> suggestions(final CommandContext<Commander> commandContext, final CommandInput input) {
    return mods().allMods()
      .map(modDescription -> (Suggestion) tooltipSuggestion(
        modDescription.modId(),
        Component.literal(modDescription.name())
      ))
      .toList();
  }

->

  @Override
  public Iterable<? extends Suggestion> suggestions(final CommandContext<Commander> commandContext, final CommandInput input) {
    return mods().allMods()
      .map(modDescription -> tooltipSuggestion(
        modDescription.modId(),
        Component.literal(modDescription.name())
      ))
      .toList();
  }

Copy link

Test Results

 84 files  ±0   84 suites  ±0   13s ⏱️ -2s
415 tests ±0  415 ✅ ±0  0 💤 ±0  0 ❌ ±0 
459 runs  ±0  459 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 819b6d0. ± Comparison against base commit 09b3edd.

@jpenilla jpenilla merged commit 8efe28d into master Feb 20, 2024
5 checks passed
@jpenilla jpenilla deleted the extends-suggestion-iterable branch February 20, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants