Skip to content

Commit f38a409

Browse files
committed
Grab the square brackets via regex so they don't need to be added to type name later.
1 parent f9fdc3e commit f38a409

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,10 +994,10 @@ private static CompletionItem CreateCompletionItem(
994994
// Look for type encoded in the tooltip for parameters and variables.
995995
// Display PowerShell type names in [] to be consistent with PowerShell syntax
996996
// and now the debugger displays type names.
997-
var matches = Regex.Matches(completionDetails.ToolTipText, @"^\[(.+)\]");
997+
var matches = Regex.Matches(completionDetails.ToolTipText, @"^(\[.+\])");
998998
if ((matches.Count > 0) && (matches[0].Groups.Count > 1))
999999
{
1000-
detailString = "[" + matches[0].Groups[1].Value + "]";
1000+
detailString = matches[0].Groups[1].Value;
10011001
}
10021002

10031003
// PowerShell returns ListItemText for parameters & variables that is not prefixed

0 commit comments

Comments
 (0)