diff --git a/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs b/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs index 06467ffcfd..0abc2bf698 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs @@ -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 /// /// /// 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. /// /// The last word located, or the empty string if no word could be found. diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs index fa292025b0..692bba496f 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs @@ -417,7 +417,7 @@ namespace System.Management.Automation break; case TokenKind.Comma: - // Hanlde array elements such as dir .\cd, || dir -Path: .\cd, + // Handle array elements such as dir .\cd, || dir -Path: .\cd, 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 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". Treat the StringLiteral/StringExpandable as path/command + // Handle scenarios like this: "c:\wind". Treat the StringLiteral/StringExpandable as path/command else { // Handle path/commandname completion for quoted string diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 60e7c0b287..8746c14cda 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -1805,7 +1805,7 @@ namespace System.Management.Automation NativeCommandArgumentCompletion(commandName, parameter.Parameter, result, commandAst, context, boundArguments); } - private static IEnumerable NativeCommandArgumentCompletion_InferTypesOfArugment( + private static IEnumerable NativeCommandArgumentCompletion_InferTypesOfArgument( Dictionary 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 } /// - /// 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. /// private static ArgumentLocation FindTargetArgumentLocation(Collection 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(); 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 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(); diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionExecutionHelper.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionExecutionHelper.cs index f8a01b82e3..6307a39566 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionExecutionHelper.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionExecutionHelper.cs @@ -12,7 +12,7 @@ namespace System.Management.Automation using System.Collections; /// - /// Auxilliary class to the execution of commands as needed by + /// Auxiliary class to the execution of commands as needed by /// CommandCompletion /// internal class CompletionExecutionHelper diff --git a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs index ed73de847b..d1ea4af2e0 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs @@ -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 /// /// /// - /// + /// /// /// /// @@ -823,7 +823,7 @@ namespace System.Management.Automation.Language internal PseudoBindingInfo( CommandInfo commandInfo, uint validParameterSetsFlags, - uint defaultParameterSetFalg, + uint defaultParameterSetFlag, Dictionary boundParameters, List unboundParameters, Dictionary 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 } /// - /// Restores original ExceutionContext host state. + /// Restores original ExecutionContext host state. /// /// ExecutionContext private void RestoreHost(ExecutionContext executionContext) @@ -1118,7 +1118,7 @@ namespace System.Management.Automation.Language private CommandAst _commandAst; private ReadOnlyCollection _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(Cmdlet.CommonParameters.Concat(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 - @@ -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;