Repository: microsoft/PowerToys
File: src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/Main.cs (C#)

Code before:
                Log.Debug(GetTranslatedPluginTitle() + ": " + e.Message, GetType());
                if (!string.IsNullOrEmpty(query.ActionKeyword))
                {
                    return GetSuggestionFuzzyResults(query, results);
                }
            }

            return results;
        }

        private List<Result> GetSuggestionResults(Query query, List<Result> results)
        {
            foreach (var generatorData in QueryHelper.GeneratorDataList)
            {
                results.Add(new Result
                {
                    Title = generatorData.GetResultTitle(),
                    SubTitle = generatorData.GetResultSubtitle(),
                    IcoPath = GetIcoPath(),
                    ToolTipData = new ToolTipData(generatorData.GetResultTitle(), generatorData.GetResultSubtitle()),
                    ToolTipVisibility = Visibility.Visible,
                    Action = c =>
                    {
                        _context.API.ChangeQuery($"{query.ActionKeyword} {generatorData.Keyword}");
                        return false;
                    },
                });
            }

            return results;
        }

        private Result GetResult(IComputeRequest request)
        {
            request.Compute();

            return new Result
            {
                ContextData = request.Result,
                Title = request.ResultToString(),
                IcoPath = GetIcoPath(),
                Score = 300,
                SubTitle = request.Description,
                Action = c =>
                {
                    var ret = false;
                    var thread = new Thread(() =>
                    {
                        try
                        {
                            Clipboard.SetText(request.ResultToString());

Review comment (bug):
To fix the wrong query override replace this code with `QueryTextDisplay=...`. The `Action` is invoked on pressing enter and `QueryTextDisplay` updates the query on selecting the result.

Code after:
                Log.Debug(GetTranslatedPluginTitle() + ": " + e.Message, GetType());
                if (!string.IsNullOrEmpty(query.ActionKeyword))
                {
                    return GetSuggestionFuzzyResults(query, results);
                }
            }

            return results;
        }

        private List<Result> GetSuggestionResults(Query query, List<Result> results)
        {
            foreach (var generatorData in QueryHelper.GeneratorDataList)
            {
                results.Add(new Result
                {
                    Title = QueryHelper.GetResultTitle(generatorData),
                    SubTitle = QueryHelper.GetResultSubtitle(generatorData),
                    IcoPath = GetIcoPath(),
                    ToolTipData = new ToolTipData(QueryHelper.GetResultTitle(generatorData), QueryHelper.GetResultSubtitle(generatorData)),
                    QueryTextDisplay = generatorData.Keyword + " ",
                    Action = c =>
                    {
                        _context.API.ChangeQuery($"{query.ActionKeyword} {generatorData.Keyword} ", true);
                        return false;
                    },
                });
            }

            return results;
        }

        private Result GetResult(IComputeRequest request)
        {
            request.Compute();

            return new Result
            {
                ContextData = request.Result,
                Title = request.ResultToString(),
                IcoPath = GetIcoPath(),
                Score = 300,
                SubTitle = request.Description,
                Action = c =>
                {
                    var ret = false;
                    var thread = new Thread(() =>
                    {
                        try
                        {
                            Clipboard.SetText(request.ResultToString());