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

Code before:
                    }

                    var completionText = !tokenAtCursorUsedBraces && !ContainsCharactersRequiringQuotes(varName)
                        ? prefix + scopePrefix + varName
                        : prefix + "{" + scopePrefix + varName + "}";
                    AddUniqueVariable(hashedResults, results, completionText, varName, toolTip);
                }
            }

            if (colon == -1)
            {
                var allVariables = context.ExecutionContext.SessionState.Internal.GetVariableTable();
                foreach (var key in allVariables.Keys)
                {
                    if (wildcardPattern.IsMatch(key))
                    {
                        var variable = allVariables[key];
                        var name = variable.Name;
                        var value = variable.Value;
                        var toolTip = value is null
                            ? key
                            : StringUtil.Format("[{0}]${1}", ToStringCodeMethods.Type(value.GetType(), dropNamespaces: true), key);
                        if (!string.IsNullOrEmpty(variable.Description))
                        {
                            toolTip += $" - {variable.Description}";
                        }
                        var completionText = !tokenAtCursorUsedBraces && !ContainsCharactersRequiringQuotes(name)
                            ? prefix + name
                            : prefix + "{" + name + "}";
                        AddUniqueVariable(hashedResults, tempResults, completionText, key, toolTip);
                    }
                }

                if (tempResults.Count > 0)
                {
                    results.AddRange(tempResults.OrderBy(item => item.ListItemText, StringComparer.OrdinalIgnoreCase));
                    tempResults.Clear();
                }
            }
            else
            {
                string pattern;
                if (s_variableScopes.Contains(scopePrefix, StringComparer.OrdinalIgnoreCase))
                {
                    pattern = string.Concat("variable:", wordToComplete, "*");
                }
                else
                {
                    pattern = scopePrefix + wordToComplete + "*";
                }


Review comment (suggestion):
```suggestion
                        if (!string.IsNullOrEmpty(variable.Description))
                        {
                            toolTip += $" - {variable.Description}";
                        }

```

Code after:
                    }

                    var completionText = !tokenAtCursorUsedBraces && !ContainsCharactersRequiringQuotes(varName)
                        ? prefix + scopePrefix + varName
                        : prefix + "{" + scopePrefix + varName + "}";
                    AddUniqueVariable(hashedResults, results, completionText, varName, toolTip);
                }
            }

            if (colon == -1)
            {
                var allVariables = context.ExecutionContext.SessionState.Internal.GetVariableTable();
                foreach (var key in allVariables.Keys)
                {
                    if (wildcardPattern.IsMatch(key))
                    {
                        var variable = allVariables[key];
                        var name = variable.Name;
                        var value = variable.Value;
                        var toolTip = value is null
                            ? key
                            : StringUtil.Format("[{0}]${1}", ToStringCodeMethods.Type(value.GetType(), dropNamespaces: true), key);
                        if (!string.IsNullOrEmpty(variable.Description))
                        {
                            toolTip += $" - {variable.Description}";
                        }

                        var completionText = !tokenAtCursorUsedBraces && !ContainsCharactersRequiringQuotes(name)
                            ? prefix + name
                            : prefix + "{" + name + "}";
                        AddUniqueVariable(hashedResults, tempResults, completionText, key, toolTip);
                    }
                }

                if (tempResults.Count > 0)
                {
                    results.AddRange(tempResults.OrderBy(item => item.ListItemText, StringComparer.OrdinalIgnoreCase));
                    tempResults.Clear();
                }
            }
            else
            {
                string pattern;
                if (s_variableScopes.Contains(scopePrefix, StringComparer.OrdinalIgnoreCase))
                {
                    pattern = string.Concat("variable:", wordToComplete, "*");
                }
                else
                {
                    pattern = scopePrefix + wordToComplete + "*";
                }