Skip to content

Commit

Permalink
Fix naming of autocomplete providers
Browse files Browse the repository at this point in the history
  • Loading branch information
OoLunar committed Nov 1, 2024
1 parent b635b5a commit 364b66d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
using DSharpPlus.Entities;
using Humanizer;

namespace OoLunar.Tomoe.AutocompleteProviders
namespace OoLunar.Tomoe.AutoCompleteProviders
{
public sealed class CommandAutocompleteProvider : IAutoCompleteProvider
public sealed class CommandAutoCompleteProvider : IAutoCompleteProvider
{
public ValueTask<IEnumerable<DiscordAutoCompleteChoice>> AutoCompleteAsync(AutoCompleteContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
using DSharpPlus.Commands.Processors.SlashCommands.ArgumentModifiers;
using DSharpPlus.Entities;

namespace OoLunar.Tomoe.AutocompleteProviders
namespace OoLunar.Tomoe.AutoCompleteProviders
{
public sealed class CultureInfoAutocompleteProvider : IAutoCompleteProvider
public sealed class CultureInfoAutoCompleteProvider : IAutoCompleteProvider
{
private static readonly CultureInfo[] _cultures;
private static readonly FrozenSet<DiscordAutoCompleteChoice> _defaultCultureList;
private static readonly FrozenDictionary<CultureInfo, string> _cultureInfoDisplayNames;

static CultureInfoAutocompleteProvider()
static CultureInfoAutoCompleteProvider()
{
_cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
Array.Sort(_cultures, (x, y) => string.Compare(x.DisplayName, y.DisplayName, StringComparison.Ordinal));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

namespace OoLunar.Tomoe.AutocompleteProviders
{
public sealed class TimeZoneInfoAutocompleteProvider : IAutoCompleteProvider
public sealed class TimeZoneInfoAutoCompleteProvider : IAutoCompleteProvider
{
private static readonly TimeZoneInfo[] _timezones;
private static readonly FrozenSet<DiscordAutoCompleteChoice> _defaultTimezoneList;
private static readonly FrozenDictionary<TimeZoneInfo, string> _timezoneDisplayNames;

static TimeZoneInfoAutocompleteProvider()
static TimeZoneInfoAutoCompleteProvider()
{
_timezones = [.. TimeZoneInfo.GetSystemTimeZones()];
Array.Sort(_timezones, (x, y) => string.Compare(x.DisplayName, y.DisplayName, StringComparison.Ordinal));
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Common/SourceCodeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using OoLunar.Tomoe.AutocompleteProviders;
using OoLunar.Tomoe.AutoCompleteProviders;

namespace OoLunar.Tomoe.Commands.Common
{
Expand Down Expand Up @@ -224,7 +224,7 @@ private static IEnumerable<T> GetNodes<T>(this IEnumerable<SyntaxNode> nodes) wh
/// Sends a link to the repository which contains the code for the bot.
/// </summary>
[Command("source_code"), TextAlias("repository", "source", "code", "repo")]
public static async ValueTask ExecuteAsync(CommandContext context, [RemainingText, SlashAutoCompleteProvider<CommandAutocompleteProvider>] string? commandName = null)
public static async ValueTask ExecuteAsync(CommandContext context, [RemainingText, SlashAutoCompleteProvider<CommandAutoCompleteProvider>] string? commandName = null)
{
if (string.IsNullOrWhiteSpace(commandName))
{
Expand Down
6 changes: 3 additions & 3 deletions src/Events/Handlers/ConfigureCommandsEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using DSharpPlus.Commands.Processors.TextCommands.ContextChecks;
using DSharpPlus.Commands.Trees;
using DSharpPlus.Entities;
using OoLunar.Tomoe.AutocompleteProviders;
using OoLunar.Tomoe.AutoCompleteProviders;

namespace OoLunar.Tomoe.Events.Handlers
{
Expand Down Expand Up @@ -40,11 +40,11 @@ public static Task ConfigureCommandsAsync(CommandsExtension _, ConfigureCommands
}
else if (baseParameterType == typeof(CultureInfo))
{
parameter.Attributes.Add(new SlashAutoCompleteProviderAttribute<CultureInfoAutocompleteProvider>());
parameter.Attributes.Add(new SlashAutoCompleteProviderAttribute<CultureInfoAutoCompleteProvider>());
}
else if (baseParameterType == typeof(TimeZoneInfo))
{
parameter.Attributes.Add(new SlashAutoCompleteProviderAttribute<TimeZoneInfoAutocompleteProvider>());
parameter.Attributes.Add(new SlashAutoCompleteProviderAttribute<TimeZoneInfoAutoCompleteProvider>());

Check failure on line 47 in src/Events/Handlers/ConfigureCommandsEventHandler.cs

View workflow job for this annotation

GitHub Actions / Build Commit

The type or namespace name 'TimeZoneInfoAutoCompleteProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 47 in src/Events/Handlers/ConfigureCommandsEventHandler.cs

View workflow job for this annotation

GitHub Actions / Build Commit

The type or namespace name 'TimeZoneInfoAutoCompleteProvider' could not be found (are you missing a using directive or an assembly reference?)
}
}
}
Expand Down

0 comments on commit 364b66d

Please sign in to comment.