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

Code before:
            IEnumerable<string> possibleCompletionValues,
            Func<string, string> toolTipMapping = null,
            CompletionResultType resultType = CompletionResultType.Text)
        {
            string quote = HandleDoubleAndSingleQuote(ref wordToComplete);
            var pattern = WildcardPattern.Get(wordToComplete + "*", WildcardOptions.IgnoreCase);

            foreach (string value in possibleCompletionValues)
            {
                if (pattern.IsMatch(value))
                {
                    string completionText = quote == string.Empty
                        ? value
                        : quote + value + quote;

                    if (toolTipMapping is not null)
                    {
                        yield return new CompletionResult(
                            completionText,
                            listItemText: value,
                            resultType,
                            toolTip: toolTipMapping(value));
                    }
                    else
                    {
                        yield return new CompletionResult(completionText);
                    }
                }
            }
        }

        internal static bool IsSplattedVariable(Ast targetExpr)
        {
            if (targetExpr is VariableExpressionAst && ((VariableExpressionAst)targetExpr).Splatted)
            {
                // It's splatted variable, member expansion is not useful
                return true;
            }

            return false;
        }

        internal static void CompleteMemberHelper(
            bool @static,
            string memberName,
            ExpressionAst targetExpr,
            CompletionContext context,
            List<CompletionResult> results)
        {
            object value;
            if (SafeExprEvaluator.TrySafeEval(targetExpr, context.ExecutionContext, out value) && value != null)

Review comment (suggestion):
```suggestion
                        yield return new CompletionResult(completionText, value, resultType, value);
```
This is so the specified resultType is actually set.

Code after:
        internal static IEnumerable<CompletionResult> GetMatchingResults(
            string wordToComplete,
            IEnumerable<string> possibleCompletionValues,
            Func<string, string> toolTipMapping = null,
            CompletionResultType resultType = CompletionResultType.Text)
        {
            string quote = HandleDoubleAndSingleQuote(ref wordToComplete);
            var pattern = WildcardPattern.Get(wordToComplete + "*", WildcardOptions.IgnoreCase);

            foreach (string value in possibleCompletionValues)
            {
                if (pattern.IsMatch(value))
                {
                    string completionText = quote == string.Empty
                        ? value
                        : quote + value + quote;

                    string listItemText = value;

                    yield return new CompletionResult(
                        completionText,
                        listItemText,
                        resultType,
                        toolTip: toolTipMapping is null
                            ? listItemText
                            : toolTipMapping(value));
                }
            }
        }

        internal static bool IsSplattedVariable(Ast targetExpr)
        {
            if (targetExpr is VariableExpressionAst && ((VariableExpressionAst)targetExpr).Splatted)
            {
                // It's splatted variable, member expansion is not useful
                return true;
            }

            return false;
        }

        internal static void CompleteMemberHelper(
            bool @static,
            string memberName,
            ExpressionAst targetExpr,
            CompletionContext context,
            List<CompletionResult> results)
        {
            object value;
            if (SafeExprEvaluator.TrySafeEval(targetExpr, context.ExecutionContext, out value) && value != null)
            {