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

Code before:
                    var ret = false;
                    var thread = new Thread(() =>
                    {
                        try
                        {
                            Clipboard.SetText(request.ResultToString());
                            ret = true;
                        }
                        catch (ExternalException)
                        {
                            MessageBox.Show(Properties.Resources.copy_failed);
                        }
                    });
                    thread.SetApartmentState(ApartmentState.STA);
                    thread.Start();
                    thread.Join();
                    return ret;
                },
            };
        }

        private List<Result> GetSuggestionFuzzyResults(Query query, List<Result> results)
        {
            foreach (var generatorData in QueryHelper.GeneratorDataList)
            {
                var matchScore = StringMatcher.FuzzySearch(query.Search, generatorData.Keyword).Score;

                if (matchScore > 0)
                {
                    results.Add(new Result
                    {
                        Title = QueryHelper.GetResultTitle(generatorData),
                        SubTitle = QueryHelper.GetResultSubtitle(generatorData),
                        IcoPath = GetIcoPath(),
                        Score = matchScore,
                        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 GetErrorResult(string errorMessage)
        {

Review comment (suggestion):
```suggestion
                var matchScore = StringMatcher.FuzzySearch(query.Search.Trim(), generatorData.Keyword).Score;
```

Is always a good idea.

Code after:
                    var ret = false;
                    var thread = new Thread(() =>
                    {
                        try
                        {
                            Clipboard.SetText(request.ResultToString());
                            ret = true;
                        }
                        catch (ExternalException)
                        {
                            MessageBox.Show(Properties.Resources.copy_failed);
                        }
                    });
                    thread.SetApartmentState(ApartmentState.STA);
                    thread.Start();
                    thread.Join();
                    return ret;
                },
            };
        }

        private List<Result> GetSuggestionFuzzyResults(Query query, List<Result> results)
        {
            foreach (var generatorData in QueryHelper.GeneratorDataList)
            {
                var matchScore = StringMatcher.FuzzySearch(query.Search.Trim(), generatorData.Keyword).Score;

                if (matchScore > 0)
                {
                    results.Add(new Result
                    {
                        Title = QueryHelper.GetResultTitle(generatorData),
                        SubTitle = QueryHelper.GetResultSubtitle(generatorData),
                        IcoPath = GetIcoPath(),
                        Score = matchScore,
                        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 GetErrorResult(string errorMessage)
        {