Skip to content

Commit b0b0e4c

Browse files
committed
Handle variables
1 parent f546dca commit b0b0e4c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,15 @@ internal static bool TryExtractType(string toolTipText, string label, out string
482482
{
483483
documentation = documentation.Substring((label + " - ").Length).Trim();
484484
}
485+
// If the documentation starts with the same name as the variable, truncate this as well.
486+
else if (documentation.StartsWith("$" + label, StringComparison.OrdinalIgnoreCase))
487+
{
488+
documentation = documentation.Substring(("$" + label).Length).Trim();
489+
}
490+
}
491+
if (string.IsNullOrWhiteSpace(documentation))
492+
{
493+
documentation = null;
485494
}
486495
}
487496

0 commit comments

Comments
 (0)