X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7705,9 +7705,7 @@ internal static List<CompletionResult> CompleteStatementFlags(TokenKind kind, st
bool withColon = wordToComplete.EndsWith(':');
wordToComplete = withColon ? wordToComplete.Remove(wordToComplete.Length - 1) : wordToComplete;

string enumString = LanguagePrimitives.EnumSingleTypeConverter.EnumValues(typeof(SwitchFlags));
string separator = CultureInfo.CurrentUICulture.TextInfo.ListSeparator;
string[] enumArray = enumString.Split(separator, StringSplitOptions.RemoveEmptyEntries);
string[] enumArray = LanguagePrimitives.EnumSingleTypeConverter.GetEnumNames(typeof(SwitchFlags));

var pattern = WildcardPattern.Get(wordToComplete + "*", WildcardOptions.IgnoreCase);
var enumList = new List<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,14 @@ internal static string EnumValues(Type enumType)
return string.Join(CultureInfo.CurrentUICulture.TextInfo.ListSeparator, enumHashEntry.names);
}

/// <summary>
/// Returns all names for the provided enum type.
/// </summary>
/// <param name="enumType">The enum type to retrieve names from.</param>
/// <returns>Array of enum names for the specified type.</returns>
internal static string[] GetEnumNames(Type enumType)
=> EnumSingleTypeConverter.GetEnumHashEntry(enumType).names;

/// <summary>
/// Returns all values for the provided enum type.
/// </summary>
Expand Down
X Tutup