Repository: PowerShell/PowerShell
File: src/System.Management.Automation/engine/CommandCompletion/CompletionHelpers.cs (C#)

Code before:
        /// <summary>
        /// Determines if the given value matches the specified word using a literal, case-insensitive prefix match.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the value starts with the word (case-insensitively); otherwise, <c>false</c>.
        /// </returns>
        internal static readonly MatchStrategy LiteralMatch = (value, wordToComplete)
            => value.StartsWith(wordToComplete, StringComparison.OrdinalIgnoreCase);

        /// <summary>
        /// Determines if the given value matches the specified word using wildcard pattern matching.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the value matches the word as a wildcard pattern; otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>
        /// Wildcard pattern matching allows for flexible matching, where wilcards can represent 
        /// multiple characters in the input. This strategy is case-insensitive.
        /// </remarks>
        internal static readonly MatchStrategy WildcardPatternMatch = (value, wordToComplete)
            => WildcardPattern
                .Get(wordToComplete + "*", WildcardOptions.IgnoreCase)
                .IsMatch(value);

        /// <summary>
        /// Determines if the given value matches the specified word using either a literal or wildcard escape strategy.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the value matches either the literal normalized word or the wildcard pattern with escaping; 
        /// otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>
        /// This strategy first attempts a literal prefix match and, if unsuccessful, escapes the word to complete to 
        /// handle any problematic wildcard characters before performing a wildcard match.
        /// </remarks>
        internal static readonly MatchStrategy WildcardPatternEscapeMatch = (value, wordToComplete)
            => LiteralMatch(value, wordToComplete) ||
               WildcardPatternMatch(value, WildcardPattern.Escape(wordToComplete));

        /// <summary>
        /// Determines if the given value matches the specified word using either a literal or wildcard match strategy.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the value matches either the literal normalized word or the wildcard pattern; otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>
        /// This strategy attempts a literal match first and, if unsuccessful, evaluates the word against a wildcard pattern.
        /// </remarks>
        internal static readonly MatchStrategy DefaultMatch = (value, wordToComplete)
            => LiteralMatch(value, wordToComplete) ||
               WildcardPatternMatch(value, wordToComplete);

Review comment (suggestion):
It's hard to understand the idea how it works. Since remarks section already have details I think we should rephrase the summary:
```suggestion
        /// Determines if the given value matches the specified word considering wildcard characters literally.
```

Code after:
        /// <summary>
        /// Determines if the given value matches the specified word using a literal, case-insensitive prefix match.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the value starts with the word (case-insensitively); otherwise, <c>false</c>.
        /// </returns>
        internal static readonly MatchStrategy LiteralMatchOrdinalIgnoreCase = (value, wordToComplete)
            => value.StartsWith(wordToComplete, StringComparison.OrdinalIgnoreCase);

        /// <summary>
        /// Determines if the given value matches the specified word using wildcard pattern matching.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the value matches the word as a wildcard pattern; otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>
        /// Wildcard pattern matching allows for flexible matching, where wilcards can represent 
        /// multiple characters in the input. This strategy is case-insensitive.
        /// </remarks>
        internal static readonly MatchStrategy WildcardPatternMatchIgnoreCase = (value, wordToComplete)
            => WildcardPattern
                .Get(wordToComplete + "*", WildcardOptions.IgnoreCase)
                .IsMatch(value);

        /// <summary>
        /// Determines if the given value matches the specified word considering wildcard characters literally.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the value matches either the literal normalized word or the wildcard pattern with escaping; 
        /// otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>
        /// This strategy first attempts a literal prefix match for performance and, if unsuccessful, escapes the word to complete to 
        /// handle any problematic wildcard characters before performing a wildcard match.
        /// </remarks>
        internal static readonly MatchStrategy WildcardPatternEscapeMatch = (value, wordToComplete)
            => LiteralMatchOrdinalIgnoreCase(value, wordToComplete) ||
               WildcardPatternMatchIgnoreCase(value, WildcardPattern.Escape(wordToComplete));

        /// <summary>
        /// Determines if the given value matches the specified word taking into account wildcard characters.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the value matches either the literal normalized word or the wildcard pattern; otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>
        /// This strategy attempts a literal match first for performance and, if unsuccessful, evaluates the word against a wildcard pattern.
        /// </remarks>
        internal static readonly MatchStrategy DefaultMatch = (value, wordToComplete)
            => LiteralMatchOrdinalIgnoreCase(value, wordToComplete) ||
               WildcardPatternMatchIgnoreCase(value, wordToComplete);