Repository: PowerShell/PowerShell
File: src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs (C#)

Code before:
                : separator;

        /// <summary>
        /// Returns completion results for PropertyType parameter.
        /// </summary>
        /// <param name="commandName">The command name.</param>
        /// <param name="parameterName">The parameter name.</param>
        /// <param name="wordToComplete">The word to complete.</param>
        /// <param name="commandAst">The command AST.</param>
        /// <param name="fakeBoundParameters">The fake bound parameters.</param>
        /// <returns>List of Completion Results.</returns>
        public IEnumerable<CompletionResult> CompleteArgument(
            string commandName,
            string parameterName,
            string wordToComplete,
            CommandAst commandAst,
            IDictionary fakeBoundParameters)
        {
            switch (parameterName)
            {
                case "FormatString":
                    return CompletionHelpers.GetMatchingResults(
                        wordToComplete,
                        possibleCompletionValues: s_formatStringValues);

                case "Separator":
                    return CompletionHelpers.GetMatchingResults(
                        wordToComplete,
                        possibleCompletionValues: s_separatorValues,
                        listItemTextMapping: GetSeparatorListItemText,
                        toolTipMapping: GetSeparatorToolTip,
                        resultType: CompletionResultType.ParameterValue);
            }

            return Array.Empty<CompletionResult>();
        }
    }
}


Review comment (suggestion):
Since we want to migrate to updated IArgumentCompleter it makes no sense to put two completers in one class. I suggest to create new class SeparatorCompleter in new PR and rename current one to FormatStringCompleter.

Code after:
    }

    /// <summary>
    /// Provides completion for the FormatString parameter of the Join-String cmdlet.
    /// </summary>
    public sealed class FormatStringArgumentCompleter : IArgumentCompleter
    {
        private static readonly IReadOnlyList<string> s_formatStringValues = new List<string>(capacity: 4)
        {
            "[{0}]",
            "{0:N2}",
#if UNIX
            "`n    `${0}",
            "`n    [string] `${0}",
#else
            "`r`n    `${0}",
            "`r`n    [string] `${0}",
#endif
        };

        /// <summary>
        /// Returns completion results for FormatString parameter.
        /// </summary>
        /// <param name="commandName">The command name.</param>
        /// <param name="parameterName">The parameter name.</param>
        /// <param name="wordToComplete">The word to complete.</param>
        /// <param name="commandAst">The command AST.</param>
        /// <param name="fakeBoundParameters">The fake bound parameters.</param>
        /// <returns>List of Completion Results.</returns>
        public IEnumerable<CompletionResult> CompleteArgument(
            string commandName,
            string parameterName,
            string wordToComplete,
            CommandAst commandAst,
            IDictionary fakeBoundParameters)
                => CompletionHelpers.GetMatchingResults(
                    wordToComplete,
                    possibleCompletionValues: s_formatStringValues,
                    matchStrategy: CompletionHelpers.WildcardPatternEscapeMatch);
    }
}