Skip to content

Commit a0597c3

Browse files
committed
Return completion values by default in quotes
1 parent 659cf94 commit a0597c3

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/Commands/Base/Completers/ContentTypeCompleter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public IEnumerable<CompletionResult> CompleteArgument(string commandName, string
1717
PnPConnection.Current.Context.ExecuteQueryRetry();
1818
foreach (var ct in result.Where(l => l.Name.StartsWith(wordToComplete, StringComparison.InvariantCultureIgnoreCase)))
1919
{
20-
var ctName = ct.Name.IndexOf(" ") > 0? $"'{ct.Name}'" : ct.Name;
20+
var ctName = $"'{ct.Name}'";
2121
yield return new CompletionResult(ctName);
2222
}
2323
}

src/Commands/Base/Completers/FieldInternalNameCompleter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public IEnumerable<CompletionResult> CompleteArgument(string commandName, string
1717
PnPConnection.Current.Context.ExecuteQueryRetry();
1818
foreach (var field in result.Where(l => l.InternalName.StartsWith(wordToComplete, StringComparison.InvariantCultureIgnoreCase)))
1919
{
20-
yield return new CompletionResult(field.InternalName);
20+
yield return new CompletionResult($"'{field.InternalName}'");
2121
}
2222
}
2323
}

src/Commands/Base/Completers/ListNameCompleter.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@
88

99
namespace PnP.PowerShell.Commands.Base.Completers
1010
{
11-
public sealed class ListNameCompleter : IArgumentCompleter
11+
public sealed class ListNameCompleter : IArgumentCompleter
1212
{
1313
public IEnumerable<CompletionResult> CompleteArgument(string commandName, string parameterName, string wordToComplete, CommandAst commandAst, IDictionary fakeBoundParameters)
1414
{
1515
IEnumerable<List> result = PnPConnection.Current.Context.LoadQuery(PnPConnection.Current.Context.Web.Lists.Include(list => list.Title));
1616
PnPConnection.Current.Context.ExecuteQueryRetry();
1717
foreach (var list in result.Where(l => l.Title.StartsWith(wordToComplete, StringComparison.InvariantCultureIgnoreCase)))
1818
{
19-
var listTitle = list.Title.IndexOf(" ") > 0 ? $"'{list.Title}'" : list.Title;
20-
yield return new CompletionResult(listTitle,list.Title,CompletionResultType.ParameterValue,list.Title);
19+
yield return new CompletionResult($"'{list.Title}'");
2120
}
2221

23-
}
22+
}
2423
}
2524
}

0 commit comments

Comments
 (0)