Skip to content
Permalink
Browse files

Spelling fixes

  • Loading branch information...
nnpcYvIVl committed Oct 4, 2019
1 parent 7bf4366 commit 71fbf48aa17120e9a1ac58faa1bd6dd4bc34ffd1
Showing with 38 additions and 38 deletions.
  1. +1 −1 docs/compilers/CSharp/Compiler Breaking Changes - VS2015.md
  2. +1 −1 docs/compilers/Design/Closure Conversion.md
  3. +1 −1 docs/contributing/Powershell Guidelines.md
  4. +1 −1 docs/features/tuples.md
  5. +1 −1 eng/targets/Settings.props
  6. +1 −1 src/Compilers/Test/Resources/Core/MetadataTests/Invalid/Signatures/TypeSpecInWrongPlace.il
  7. +1 −1 src/EditorFeatures/CSharp/CompleteStatement/CompleteStatementCommandHandler.cs
  8. +1 −1 src/Features/CSharp/Portable/AddBraces/CSharpAddBracesDiagnosticAnalyzer.cs
  9. +1 −1 ...dio/Core/Def/Implementation/Diagnostics/VisualStudioWorkspaceDiagnosticAnalyzerProviderService.cs
  10. +1 −1 src/VisualStudio/Core/Def/Implementation/PreviewPane/PreviewPane.xaml.cs
  11. +1 −1 src/VisualStudio/Core/Def/Implementation/ProjectSystem/Legacy/SolutionEventsBatchScopeCreator.cs
  12. +1 −1 ...plementation/ProjectSystem/MetadataReferences/VisualStudioFrameworkAssemblyPathResolverFactory.cs
  13. +1 −1 src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.OpenFileTracker.cs
  14. +1 −1 src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
  15. +1 −1 src/VisualStudio/Core/Def/Implementation/PullMemberUp/SymbolDependentsBuilder.cs
  16. +1 −1 src/VisualStudio/Core/Def/Implementation/Remote/JsonRpcClient.cs
  17. +1 −1 src/VisualStudio/Core/Def/Implementation/Remote/ServiceHubRemoteHostClient.Connections.cs
  18. +1 −1 src/VisualStudio/Core/Def/Implementation/VirtualMemoryNotificationListener.cs
  19. +1 −1 src/VisualStudio/Core/Def/Utilities/IVsEditorAdaptersFactoryServiceExtensions.cs
  20. +1 −1 src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs
  21. +1 −1 src/Workspaces/CSharp/Portable/CodeStyle/PreferBracesPreference.cs
  22. +1 −1 src/Workspaces/CSharp/Portable/Extensions/CastExpressionSyntaxExtensions.cs
  23. +1 −1 src/Workspaces/Core/Portable/Execution/AbstractReferenceSerializationService.cs
  24. +1 −1 src/Workspaces/Core/Portable/FindSymbols/FindReferences/BaseTypeFinder.cs
  25. +1 −1 src/Workspaces/Core/Portable/FindSymbols/FindReferences/DependentTypeFinder.cs
  26. +1 −1 src/Workspaces/Core/Portable/Remote/IRemoteHostClientService.cs
  27. +1 −1 src/Workspaces/Core/Portable/Utilities/EditDistance.cs
  28. +2 −2 src/Workspaces/Core/Portable/Utilities/StringEscapeEncoder.cs
  29. +2 −2 src/Workspaces/Core/Portable/Workspace/Host/Metadata/IFrameworkAssemblyPathResolver.cs
  30. +1 −1 src/Workspaces/Core/Portable/Workspace/Solution/Document.cs
  31. +1 −1 src/Workspaces/Core/Portable/Workspace/Solution/ProjectDependencyGraph.cs
  32. +2 −2 src/Workspaces/Core/Portable/Workspace/Solution/ProjectState.cs
  33. +1 −1 src/Workspaces/CoreTest/FindReferencesTests.cs
  34. +1 −1 src/Workspaces/CoreTest/UtilityTest/EditDistanceTests.cs
  35. +1 −1 src/Workspaces/Remote/Core/Services/TemporaryWorkspace.cs
@@ -180,7 +180,7 @@ Prior to DevDiv #656739, Roslyn reported that || was ambiguous in the example ab
Bug 9510: Error CS0182 (An attribute argument must be a constant expression) should not be issued for 'new' expressions of enum types
As per the specification, new expressions of enum types cannot have a constant value. However native compiler violates this for paramterless value type constructors and Roslyn maintains compatibility by constant folding paramterless value type constructors. This applies also to enum types.
As per the specification, new expressions of enum types cannot have a constant value. However native compiler violates this for parameterless value type constructors and Roslyn maintains compatibility by constant folding parameterless value type constructors. This applies also to enum types.
### C# spec deviation: New Int32() treated as constant 0
@@ -40,7 +40,7 @@ struct Environment
}
```

Instead of referring to local variables, the rewritten closure now references fields on the environment. A `struct` environment is used to prevent extra allocations, since `struct`s are normally allocated on the stack. However, the astute reader may notice a problem with this conversion -- `struct`s are always copied when passed as arguments to a function call! This means that writes to the environment field will not always propogate back to the local variable in the method `M`. To work around this flaw, all Environment variables are passed as `ref` arguments to the rewritten closures.
Instead of referring to local variables, the rewritten closure now references fields on the environment. A `struct` environment is used to prevent extra allocations, since `struct`s are normally allocated on the stack. However, the astute reader may notice a problem with this conversion -- `struct`s are always copied when passed as arguments to a function call! This means that writes to the environment field will not always propagate back to the local variable in the method `M`. To work around this flaw, all Environment variables are passed as `ref` arguments to the rewritten closures.

The second strategy for rewriting closures is necessary when the closure interacts with external code. Consider the following program:

@@ -13,7 +13,7 @@ approaches. The guidelines below are meant to push scripts to this mindset of e
1. Use Pascal casing for functions and where possible follow the Verb-Name convention.
1. Use Camel casing for all other identifier.
1. Use full command names instead of aliass. For example `Get-Content` vs. `gc`. Aliases can be
overriden by the environment and hence are not considered portable.
overridden by the environment and hence are not considered portable.

# General Guidelines

@@ -247,7 +247,7 @@ M1((1, 2)); // first overload is used. Identity conversion is better than i
M1(("hi", "hello")); // second overload is used. Implicit tuple conversion is better than no conversion.
```

Target typing will "see through" nullable target types. A successfull conversion from tuple expression to a nullable tuple type is classified as _ImplicitNullable_ conversion.
Target typing will "see through" nullable target types. A successful conversion from tuple expression to a nullable tuple type is classified as _ImplicitNullable_ conversion.

```C#
((int x, int y, int z)?, int t)? SpaceTime()
@@ -58,7 +58,7 @@
<PropertyGroup Condition="'$(IsTestProject)' == 'true'" >
<!--
Choose default target frameworks to use for testing on Mono and Core.
These may be overriden by projects that need to be skipped.
These may be overridden by projects that need to be skipped.
-->
<TestTargetFrameworks Condition="'$(TestRuntime)' == 'Mono'">net46;net472</TestTargetFrameworks>
<TestTargetFrameworks Condition="'$(TestRuntime)' == 'Core'">netcoreapp2.1</TestTargetFrameworks>
@@ -1,7 +1,7 @@
//
// Example #5 -- using (CLASS | VALUETYPE) TypeSpec instead of embedding the type in to the signature.
//
// build.bat will change the siganture of User::X to use a TypeSpec for List<int> instead of embedding GENERICINST in the signature.
// build.bat will change the signature of User::X to use a TypeSpec for List<int> instead of embedding GENERICINST in the signature.
//
// * peverify correctly identifies error:
// [MD]: Error: Signature has token following ELEMENT_TYPE_CLASS (_VALUETYPE) that is not a TypeDef or TypeRef (token: 0x1b000001; offset: 0x00000005). [token:0x06000002]
@@ -227,7 +227,7 @@ private static bool TryGetCaretPositionToMove(SyntaxNode statementNode, Snapshot
switch (statementNode.Kind())
{
case SyntaxKind.DoStatement:
// Move caret after the do statment's closing paren.
// Move caret after the do statement's closing paren.
targetPosition = caret.Snapshot.GetPoint(((DoStatementSyntax)statementNode).CloseParenToken.Span.End);
return true;
case SyntaxKind.ForStatement:
@@ -257,7 +257,7 @@ private static bool RequiresBracesToMatchContext(SyntaxNode statement)
/// part of the <c>if</c>/<c>else if</c>/<c>else</c> sequence.
/// </summary>
/// <remarks>
/// <para>For the purpose of brace usage analysis, the embedded statments of an <c>if</c>/<c>else if</c>/<c>else</c>
/// <para>For the purpose of brace usage analysis, the embedded statements of an <c>if</c>/<c>else if</c>/<c>else</c>
/// sequence are considered sibling statements, even though they don't appear as immediate siblings in the
/// syntax tree. This method walks up the syntax tree to find the <c>if</c> statement that starts the
/// sequence.</para>
@@ -77,7 +77,7 @@ internal static ImmutableArray<HostDiagnosticAnalyzerPackage> GetHostAnalyzerPac
{
try
{
// dynamic is wierd. it can't see internal type with public interface even if callee is
// dynamic is weird. it can't see internal type with public interface even if callee is
// implementation of the public interface in internal type. so we can't use dynamic here

var builder = ImmutableArray.CreateBuilder<HostDiagnosticAnalyzerPackage>();
@@ -201,7 +201,7 @@ private FrameworkElement GetPreviewElement(object previewItem)
Contract.ThrowIfFalse(_differenceViewerPreview == null);

// cache the diff viewer so that we can close it when panel goes away.
// this is a bit wierd since we are mutating state here.
// this is a bit weird since we are mutating state here.
_differenceViewerPreview = (DifferenceViewerPreview)previewItem;
PreviewDockPanel.Background = _differenceViewerPreview.Viewer.InlineView.Background;

@@ -109,7 +109,7 @@ private void EnsureSubscribedToSolutionEvents()
var solution = (IVsSolution)_serviceProvider.GetService(typeof(SVsSolution));

// We never unsubscribe from these, so we just throw out the cookie. We could consider unsubscribing if/when all our
// projects are unloaded, but it seems fairly unecessary -- it'd only be useful if somebody closed one solution but then
// projects are unloaded, but it seems fairly unnecessary -- it'd only be useful if somebody closed one solution but then
// opened other solutions in entirely different languages from there.
if (ErrorHandler.Succeeded(solution.AdviseSolutionEvents(new SolutionEventsEventSink(this), out _)))
{
@@ -161,7 +161,7 @@ private Assembly ResolveAssembly(ProjectId projectId, string assemblyName)
catch (InvalidOperationException)
{
// VsTargetFrameworkProvider throws InvalidOperationException in the
// some cases (like when targetting packs are missing). In that case
// some cases (like when targeting packs are missing). In that case
// we can't resolve this path.
return null;
}
@@ -172,7 +172,7 @@ private ProjectId GetActiveContextProjectIdAndWatchHierarchies(string moniker, I
_foregroundAffinitization.AssertIsForeground();

// First clear off any existing IVsHierarchies we are watching. Any ones that still matter we will resubscribe to.
// We could be fancy and diff, but the cost is probably neglible.
// We could be fancy and diff, but the cost is probably negligible.
UnsubscribeFromWatchedHierarchies(moniker);

if (hierarchy == null)
@@ -1835,7 +1835,7 @@ private void RefreshMetadataReferencesForFile(object sender, string fullFilePath
{
// Loop to find each reference with the given path. It's possible that there might be multiple references of the same path;
// the project system could concievably add the same reference multiple times but with different aliases. It's also possible
// we might not find the path at all: when we recieve the file changed event, we aren't checking if the file is still
// we might not find the path at all: when we receive the file changed event, we aren't checking if the file is still
// in the workspace at that time; it's possible it might have already been removed.
foreach (var portableExecutableReference in project.MetadataReferences.OfType<PortableExecutableReference>())
{
@@ -70,7 +70,7 @@ public override void Visit(IOperation operation)
}

// This check is added for checking method invoked in the member
// It is seperated since IInvocationOperation is not subtype of IMemberReferenceOperation
// It is separated since IInvocationOperation is not subtype of IMemberReferenceOperation
// issue for this https://github.com/dotnet/roslyn/issues/26206#issuecomment-382105829
if (operation is IInvocationOperation methodReferenceOp &&
_membersInType.Contains(methodReferenceOp.TargetMethod))
@@ -121,7 +121,7 @@ private void HandleException(Exception ex, CancellationToken cancellationToken)

// we are getting unexpected exception from service hub. rather than doing hard crash on unexpected exception,
// we decided to do soft crash where we show info bar to users saying "VS got corrupted and users should save
// thier works and close VS"
// their works and close VS"
ThrowSoftCrashException(ex, cancellationToken);
}

@@ -93,7 +93,7 @@ internal static class Connections
// when it couldn't connect to service hub service for some reasons
// (ex, OOP process GC blocked and not responding to request)
//
// we have double re-try here. we have these 2 seperated since 2 retries are for different problems.
// we have double re-try here. we have these 2 separated since 2 retries are for different problems.
// as noted by 2 different issues above at the start of each 2 different retries.
// first retry most likely deal with real issue on servicehub, second retry (cancellation) is to deal with
// by design servicehub behavior we don't want to use.
@@ -130,7 +130,7 @@ private bool ShouldTurnOffFullSolutionAnalysis(long availableMemory)
{
// conditions
// 1. if available memory is less than the threshold and
// 2. if full solution analysis memory monitor is on (user can set it off using registery, when he does, we will never show info bar) and
// 2. if full solution analysis memory monitor is on (user can set it off using registry, when he does, we will never show info bar) and
// 3. if our full solution analysis option is on (not user full solution analysis option, but our internal one) and
// 4. if infobar is never shown to users for this solution
return availableMemory < MemoryThreshold &&
@@ -21,7 +21,7 @@ internal static class IVsEditorAdaptersFactoryServiceExtensions
CancellationToken cancellationToken)
{
// https://github.com/dotnet/roslyn/issues/17898
// We have a report of a null ref occuring in this method. The only place we believe
// We have a report of a null ref occurring in this method. The only place we believe
// this could be would be if 'document' was null. Try to catch a reasonable
// non -fatal-watson dump to help track down what the root cause of this might be.
var document = workspace.CurrentSolution.GetDocument(contextDocumentId);
@@ -239,7 +239,7 @@ public void RemoveDynamicFile(string filePath)

public void SetRuleSetFile(string filePath)
{
// This is now a no-op: we also recieve the rule set file through SetOptions, and we'll just use that one
// This is now a no-op: we also receive the rule set file through SetOptions, and we'll just use that one
}

private readonly ConcurrentQueue<VisualStudioProject.BatchScope> _batchScopes = new ConcurrentQueue<VisualStudioProject.BatchScope>();
@@ -46,7 +46,7 @@ internal enum PreferBracesPreference
/// <item><description>Braces may be omitted when the entire statement is placed on one line.</description></item>
/// <item><description>For a statement that contains one or more embedded statements, braces may be omitted when
/// every embedded statement fits on one line, and the part preceding the embedded statement is placed on one
/// line. If any embedded statement uses braces, braces are preferred for all embedded statments of the same
/// line. If any embedded statement uses braces, braces are preferred for all embedded statements of the same
/// parent statement. For the purposes of evaluating this rule, if the embedded statement following an
/// <c>else</c> keyword is an if statement, the embedded statements of the nested if statement are treated as
/// children of the parent statement of the <c>else</c> keyword.</description></item>
@@ -200,7 +200,7 @@ private static bool ParameterTypeMatchesParamsElementType(IParameterSymbol param
{
if (parameter?.IsParams == true)
{
// if the method is defined with errors: void M(params int wrongDefined), paramter.IsParams == true but paramter.Type is not an array.
// if the method is defined with errors: void M(params int wrongDefined), parameter.IsParams == true but parameter.Type is not an array.
// In such cases is better to be conservative and opt out.
if (!(parameter.Type is IArrayTypeSymbol parameterType))
{
@@ -757,7 +757,7 @@ private sealed class MissingMetadataReference : PortableExecutableReference
MetadataReferenceProperties properties, string fullPath, DocumentationProvider initialDocumentation)
: base(properties, fullPath, initialDocumentation)
{
// TODO: doc comment provider is a bit wierd.
// TODO: doc comment provider is a bit weird.
_provider = initialDocumentation;
}

@@ -48,7 +48,7 @@ internal static partial class BaseTypeFinder
// For both overridden and inherited members,
// find all explicit and implicit interface implementations.
// We need to start from each base class for cases like N() Implements I.M()
// where N() can be hidden or overwritted in a nested class later on.
// where N() can be hidden or overwritten in a nested class later on.
interfaceImplementations.AddRange(member.ExplicitOrImplicitInterfaceImplementations());
}
}
@@ -97,7 +97,7 @@ internal static partial class DependentTypeFinder
var builder = ArrayBuilder<SymbolAndProjectId<INamedTypeSymbol>>.GetInstance();

// Group by projectId so that we only process one project/compilation at a time.
// Also, process in dependency order so taht previous compilations are ready if
// Also, process in dependency order so that previous compilations are ready if
// they're referenced by later compilations.
var dependencyOrder = solution.GetProjectDependencyGraph()
.GetTopologicallySortedProjects()
@@ -16,7 +16,7 @@ internal interface IRemoteHostClientService : IWorkspaceService
/// <summary>
/// Request new remote host.
///
/// this is designed to be not disruptive to existing callers and to support scenarioes where
/// this is designed to be not disruptive to existing callers and to support scenarios where
/// features required to reload user extension dlls without re-launching VS.
///
/// if someone requests new remote host, all new callers for <see cref="TryGetRemoteHostClientAsync(CancellationToken)"/> will
@@ -107,7 +107,7 @@ public int GetEditDistance(string target, int threshold = int.MaxValue)
new ThreadLocal<int[,]>(() => InitializeMatrix(new int[MaxMatrixPoolDimension, MaxMatrixPoolDimension]));

// To find swapped characters we make use of a table that keeps track of the last location
// we found that character. For performnace reasons we only do this work for ascii characters
// we found that character. For performance reasons we only do this work for ascii characters
// (i.e. with value <= 127). This allows us to just use a simple array we can index into instead
// of needing something more expensive like a dictionary.
private const int LastSeenIndexLength = 128;
@@ -38,14 +38,14 @@ public static string Escape(this string text, char escapePrefix, params char[] p

if (index > startIndex)
{
// everything between the start and the prohibitted character
// everything between the start and the prohibited character
builder.Append(text, startIndex, index - startIndex);
}

// add the escape prefix before the character that needs escaping
builder.Append(escapePrefix);

// add the prohibitted character data as hex after the prefix
// add the prohibited character data as hex after the prefix
builder.AppendFormat("{0:X2}", (int)text[index]);

startIndex = index + 1;
@@ -5,8 +5,8 @@ namespace Microsoft.CodeAnalysis.Host
/// <summary>
/// Provides a way to map from an assembly name to the actual path of the .NET Framework
/// assemby with that name in the context of a specified project. For example, if the
/// assembly name is "System.Data" then a project targetting .NET 2.0 would resolve this
/// to a different path than a project targetting .NET 4.5.
/// assembly name is "System.Data" then a project targeting .NET 2.0 would resolve this
/// to a different path than a project targeting .NET 4.5.
/// </summary>
internal interface IFrameworkAssemblyPathResolver : IWorkspaceService
{

0 comments on commit 71fbf48

Please sign in to comment.
You can’t perform that action at this time.