File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/System.Management.Automation/engine/CommandCompletion Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -691,8 +691,9 @@ private static List<CompletionResult> InvokeLegacyTabExpansion(PowerShell powers
691
691
/// </remarks>
692
692
private static class PSv2CompletionCompleter
693
693
{
694
+ private const string CharsRequiringQuotedString = "`&@'#{}()$,;|<> \t " ;
695
+
694
696
private static readonly Regex s_cmdletTabRegex = new Regex ( @"^[\w\*\?]+-[\w\*\?]*" ) ;
695
- private static readonly char [ ] s_charsRequiringQuotedString = "`&@'#{}()$,;|<> \t " . ToCharArray ( ) ;
696
697
697
698
#region "Handle Command"
698
699
@@ -939,7 +940,7 @@ internal static List<CompletionResult> PSv2GenerateMatchSetOfFiles(PowerShellExe
939
940
940
941
private static string AddQuoteIfNecessary ( string completionText , string quote , bool completingAtStartOfLine )
941
942
{
942
- if ( completionText . IndexOfAny ( s_charsRequiringQuotedString ) != - 1 )
943
+ if ( completionText . AsSpan ( ) . IndexOfAny ( CharsRequiringQuotedString ) >= 0 )
943
944
{
944
945
bool needAmpersand = quote . Length == 0 && completingAtStartOfLine ;
945
946
string quoteInUse = quote . Length == 0 ? "'" : quote ;
You can’t perform that action at this time.
0 commit comments