spelling: locals in src/System.Management.Automation/engine/CommandCompletion

This commit is contained in:
Josh Soref 2016-09-01 14:49:29 +00:00
parent 49fc2e96ef
commit 7ec70ee30d
5 changed files with 33 additions and 33 deletions

View file

@ -891,7 +891,7 @@ namespace System.Management.Automation
// NTRAID#Windows Out Of Band Releases-927933-2006/03/13-JeffJon
// Need to detect when the path is a provider-direct path and make sure
// to remove the provider-qualifer when the resolved path is returned.
// to remove the provider-qualifier when the resolved path is returned.
bool isProviderDirectPath = lastWord.StartsWith(@"\\", StringComparison.Ordinal) ||
lastWord.StartsWith("//", StringComparison.Ordinal);
@ -1167,7 +1167,7 @@ namespace System.Management.Automation
/// </param>
/// <param name="closingQuote">
/// Receives the quote character that would be needed to end the sentence with a balanced pair of quotes. For
/// instance, if sentence is "foo then " is returned, if sentence if "foo" then nothing is resturned, if sentence is
/// instance, if sentence is "foo then " is returned, if sentence if "foo" then nothing is returned, if sentence is
/// 'foo then ' is returned, if sentence is 'foo' then nothing is returned.
/// </param>
/// <returns>The last word located, or the empty string if no word could be found.</returns>

View file

@ -417,7 +417,7 @@ namespace System.Management.Automation
break;
case TokenKind.Comma:
// Hanlde array elements such as dir .\cd,<tab> || dir -Path: .\cd,<tab>
// Handle array elements such as dir .\cd,<tab> || dir -Path: .\cd,<tab>
if (lastAst is ErrorExpressionAst &&
(lastAst.Parent is CommandAst || lastAst.Parent is CommandParameterAst))
{
@ -561,7 +561,7 @@ namespace System.Management.Automation
//
// Handle following scenario, cursor is in next line and after a command call,
// we need to skip the command call autocompletion if there is no backtick character
// in the end of the prevous line, since backtick means command call continues to the next line
// in the end of the previous line, since backtick means command call continues to the next line
//
// Configuration config
// {
@ -596,7 +596,7 @@ namespace System.Management.Automation
// new-object System.Drawing.Point -prop @{ X = 100; Y = <- Incomplete line
// new-object new-object System.Drawing.Point -prop @{ X = <- Tab will yield hash properties.
if (hashTableAst != null &&
CheckForPendingAssigment(hashTableAst))
CheckForPendingAssignment(hashTableAst))
{
return result;
}
@ -777,7 +777,7 @@ namespace System.Management.Automation
return result;
}
// Helper method to auto complete hashtale key
// Helper method to auto complete hashtable key
private List<CompletionResult> GetResultForHashtable(CompletionContext completionContext)
{
var lastAst = completionContext.RelatedAsts.Last();
@ -837,7 +837,7 @@ namespace System.Management.Automation
}
// Helper method to look for an incomplete assignment pair in hash table.
private bool CheckForPendingAssigment(HashtableAst hashTableAst)
private bool CheckForPendingAssignment(HashtableAst hashTableAst)
{
foreach (var keyValue in hashTableAst.KeyValuePairs)
{
@ -1214,7 +1214,7 @@ namespace System.Management.Automation
replacementIndex = completionContext.ReplacementIndex;
replacementLength = completionContext.ReplacementLength;
}
// Hanlde scenarios like this: "c:\wind"<tab>. Treat the StringLiteral/StringExpandable as path/command
// Handle scenarios like this: "c:\wind"<tab>. Treat the StringLiteral/StringExpandable as path/command
else
{
// Handle path/commandname completion for quoted string

View file

@ -1805,7 +1805,7 @@ namespace System.Management.Automation
NativeCommandArgumentCompletion(commandName, parameter.Parameter, result, commandAst, context, boundArguments);
}
private static IEnumerable<PSTypeName> NativeCommandArgumentCompletion_InferTypesOfArugment(
private static IEnumerable<PSTypeName> NativeCommandArgumentCompletion_InferTypesOfArgument(
Dictionary<string, AstParameterArgumentPair> boundArguments,
CommandAst commandAst,
CompletionContext context,
@ -2527,7 +2527,7 @@ namespace System.Management.Automation
else if (boundArguments != null && boundArguments.ContainsKey("InputObject"))
{
gotInstance = true;
cimClassTypeNames = NativeCommandArgumentCompletion_InferTypesOfArugment(boundArguments, commandAst, context, "InputObject");
cimClassTypeNames = NativeCommandArgumentCompletion_InferTypesOfArgument(boundArguments, commandAst, context, "InputObject");
}
if (cimClassTypeNames != null)
@ -3893,7 +3893,7 @@ namespace System.Management.Automation
}
/// <summary>
/// Find the location where 'tab' is typed based on the line and colum.
/// Find the location where 'tab' is typed based on the line and column.
/// </summary>
private static ArgumentLocation FindTargetArgumentLocation(Collection<AstParameterArgumentPair> parsedArguments, Token token)
{
@ -4326,7 +4326,7 @@ namespace System.Management.Automation
}
catch (Exception e)
{
// The object at the specifie path is not accessable, such as c:\hiberfil.sys (for hibernation) or c:\pagefile.sys (for paging)
// The object at the specified path is not accessable, such as c:\hiberfil.sys (for hibernation) or c:\pagefile.sys (for paging)
// We ignore those files
CommandProcessorBase.CheckForSevereException(e);
continue;
@ -5857,8 +5857,8 @@ namespace System.Management.Automation
#region Process_LoadedAssemblies
var assembliesExludingPSGenerated = ClrFacade.GetAssemblies();
var allPublicTypes = assembliesExludingPSGenerated.SelectMany(assembly => assembly.GetTypes().Where(TypeResolver.IsPublic));
var assembliesExcludingPSGenerated = ClrFacade.GetAssemblies();
var allPublicTypes = assembliesExcludingPSGenerated.SelectMany(assembly => assembly.GetTypes().Where(TypeResolver.IsPublic));
foreach (var type in allPublicTypes)
{
@ -6064,7 +6064,7 @@ namespace System.Management.Automation
}
}
//this is a temparary fix. Only the type defined in the same script get complete. Need to use using Module when that is available.
//this is a temporary fix. Only the type defined in the same script get complete. Need to use using Module when that is available.
var scriptBlockAst = (ScriptBlockAst)context.RelatedAsts[0];
var typeAsts = scriptBlockAst.FindAll(ast => ast is TypeDefinitionAst, false).Cast<TypeDefinitionAst>();
foreach (var typeAst in typeAsts.Where(ast => pattern.IsMatch(ast.Name)))
@ -6251,7 +6251,7 @@ namespace System.Management.Automation
{
Diagnostics.Assert(ast.Keyword != null, "DynamicKeywordStatementAst.Keyword can never be null");
List<CompletionResult> results = null;
var dynamicKeywordProperies = ast.Keyword.Properties;
var dynamicKeywordProperties = ast.Keyword.Properties;
var memberPattern = completionContext.WordToComplete + "*";
//
@ -6269,10 +6269,10 @@ namespace System.Management.Automation
}
}
if (dynamicKeywordProperies.Count > 0)
if (dynamicKeywordProperties.Count > 0)
{
// Excludes existing properties in the hashtable statement
var tempProperties = dynamicKeywordProperies.Where(p => !propertiesName.Contains(p.Key, StringComparer.OrdinalIgnoreCase));
var tempProperties = dynamicKeywordProperties.Where(p => !propertiesName.Contains(p.Key, StringComparer.OrdinalIgnoreCase));
if (tempProperties != null && tempProperties.Any())
{
results = new List<CompletionResult>();

View file

@ -12,7 +12,7 @@ namespace System.Management.Automation
using System.Collections;
/// <summary>
/// Auxilliary class to the execution of commands as needed by
/// Auxiliary class to the execution of commands as needed by
/// CommandCompletion
/// </summary>
internal class CompletionExecutionHelper

View file

@ -333,7 +333,7 @@ namespace System.Management.Automation.Language
PseudoBindingInfo pseudoBinding = null;
if (Runspace.DefaultRunspace == null)
{
lock (s_bindCommandlLock)
lock (s_bindCommandLock)
{
if (s_bindCommandPowerShell == null)
{
@ -360,7 +360,7 @@ namespace System.Management.Automation.Language
return new StaticBindingResult(commandAst, pseudoBinding);
}
private static Object s_bindCommandlLock = new Object();
private static Object s_bindCommandLock = new Object();
private static PowerShell s_bindCommandPowerShell = null;
}
@ -809,7 +809,7 @@ namespace System.Management.Automation.Language
/// </summary>
/// <param name="commandInfo"></param>
/// <param name="validParameterSetsFlags"></param>
/// <param name="defaultParameterSetFalg"></param>
/// <param name="defaultParameterSetFlag"></param>
/// <param name="boundParameters"></param>
/// <param name="unboundParameters"></param>
/// <param name="boundArguments"></param>
@ -823,7 +823,7 @@ namespace System.Management.Automation.Language
internal PseudoBindingInfo(
CommandInfo commandInfo,
uint validParameterSetsFlags,
uint defaultParameterSetFalg,
uint defaultParameterSetFlag,
Dictionary<string, MergedCompiledCommandParameter> boundParameters,
List<MergedCompiledCommandParameter> unboundParameters,
Dictionary<string, AstParameterArgumentPair> boundArguments,
@ -838,7 +838,7 @@ namespace System.Management.Automation.Language
CommandInfo = commandInfo;
InfoType = PseudoBindingInfoType.PseudoBindingSucceed;
ValidParameterSetsFlags = validParameterSetsFlags;
DefaultParameterSetFlag = defaultParameterSetFalg;
DefaultParameterSetFlag = defaultParameterSetFlag;
BoundParameters = boundParameters;
UnboundParameters = unboundParameters;
BoundArguments = boundArguments;
@ -1095,7 +1095,7 @@ namespace System.Management.Automation.Language
}
/// <summary>
/// Restores original ExceutionContext host state.
/// Restores original ExecutionContext host state.
/// </summary>
/// <param name="executionContext">ExecutionContext</param>
private void RestoreHost(ExecutionContext executionContext)
@ -1118,7 +1118,7 @@ namespace System.Management.Automation.Language
private CommandAst _commandAst;
private ReadOnlyCollection<CommandElementAst> _commandElements;
// binding realted states
// binding related states
private bool _function = false;
private string _commandName = null;
private CommandInfo _commandInfo = null;
@ -1152,7 +1152,7 @@ namespace System.Management.Automation.Language
_ignoredWorkflowParameters = new List<string>(Cmdlet.CommonParameters.Concat<string>(Cmdlet.OptionalCommonParameters));
_ignoredWorkflowParameters.RemoveAll(item => supportedCommonParameters.Contains(item, StringComparer.OrdinalIgnoreCase));
// Initializing binding realted members
// Initializing binding related members
_function = false;
_commandName = null;
_currentParameterSetFlag = uint.MaxValue;
@ -1285,7 +1285,7 @@ namespace System.Management.Automation.Language
context.CurrentCommandProcessor = commandProcessor;
commandProcessor.SetCurrentScopeToExecutionScope();
// Run method "BindCommandLineParametersNoValidation" to get all available parameters, including the dynamic
// parameters (some of them, not necessarilly all. Since we don't do the actual binding, some dynamic parameters
// parameters (some of them, not necessarily all. Since we don't do the actual binding, some dynamic parameters
// might not be retrieved).
if (!retryWithNoArgs)
{
@ -1621,7 +1621,7 @@ namespace System.Management.Automation.Language
catch (ParameterBindingException e)
{
// The parameterName is resolved to multiple parameters. The most possible scenario for this
// would be the user typping tab to complete a parameter. In this case, we can ignore this
// would be the user typing tab to complete a parameter. In this case, we can ignore this
// parameter safely.
// If the next item is a pure argument, we skip it so that it doesn't get bound
@ -1723,7 +1723,7 @@ namespace System.Management.Automation.Language
catch (ParameterBindingException)
{
// The next parameter name is ambiguous. We just set
// a fake argument for the current paramter.
// a fake argument for the current parameter.
FakePair newArg = new FakePair(argument.Parameter);
result.Add(newArg);
}
@ -1839,7 +1839,7 @@ namespace System.Management.Automation.Language
catch (InvalidOperationException)
{
// This exception is thrown because the binder found two positional parameters
// from the same parameter set with the same position defined. The parameter denition
// from the same parameter set with the same position defined. The parameter definition
// is ambiguous. We give up binding in this case
_bindingEffective = false;
return result;
@ -1867,7 +1867,7 @@ namespace System.Management.Automation.Language
break;
}
// The positional pseudo binding is processed in two different approches for parameter completion and parameter argument completion.
// The positional pseudo binding is processed in two different approaches for parameter completion and parameter argument completion.
// - For parameter completion, we do NOT honor the default parameter set, so we can preserve potential parameters as many as possible.
// Example:
// Where-Object PropertyA -<tab>
@ -2011,7 +2011,7 @@ namespace System.Management.Automation.Language
}
}
// We preserve all posibilities
// We preserve all possibilities
if (bindingSuccessful && localParameterSetFlag != 0)
_currentParameterSetFlag &= localParameterSetFlag;
return bindingSuccessful;