Skip to content

Commit 79264e1

Browse files
committed
Fix error CS8347, usage of usingNamespaces exceeds its lifetime
Caught by .NET 7.0 compiler.
1 parent 7c8494a commit 79264e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PowerShellEditorServices/Utility/FormatUtils.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ internal static class FormatUtils
2323

2424
private const string Static = "static ";
2525

26+
private static HashSet<string>? usingNamespaces;
27+
2628
/// <summary>
2729
/// Space, new line, carriage return and tab.
2830
/// </summary>
@@ -164,9 +166,9 @@ private static string GetMethodDocumentation(ReadOnlySpan<char> toolTip, out Mar
164166
{
165167
kind = MarkupKind.Markdown;
166168
StringBuilder text = new();
167-
HashSet<string>? usingNamespaces = null;
168169
while (true)
169170
{
171+
usingNamespaces = null;
170172
toolTip = toolTip.TrimStart(s_whiteSpace.Span);
171173
toolTip = ProcessMethod(toolTip, text, ref usingNamespaces);
172174
if (toolTip.IsEmpty)

0 commit comments

Comments
 (0)