Skip to content

Commit

Permalink
Typo fixes from your friendly Grammatik-Enthusiast
Browse files Browse the repository at this point in the history
  • Loading branch information
scooter12 committed Nov 27, 2024
1 parent 5e19b3d commit 37184b5
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private static extern int NtQueryInformationProcess(IntPtr processHandle,
/// Gets the parent of this given process if it exits and you have access
/// </summary>
/// <param name="process">The process to get the parent of</param>
/// <returns>The parent process or null if you don't have access or it does not exist </returns>
/// <returns>The parent process or null if you don't have access, or it does not exist </returns>
public static Process? GetParent(this Process? process)
{
if (process == null) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace SGF.Diagnostics
internal struct ProcessInformation
{
/// <summary>
/// Contains the same value that GetExitCodeProcess returns. However the use of GetExitCodeProcess is preferable for clarity and safety.
/// Contains the same value that GetExitCodeProcess returns, however the use of GetExitCodeProcess is preferable for clarity and safety.
/// </summary>
public IntPtr ExitStatus;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void Register()
=> CoRegisterMessageFilter(new MessageFilter());

/// <summary>
/// Removes this assembly an a com message interceptor.
/// Removes this assembly's com message interceptor.
/// </summary>
public static void Revoke()
=> CoRegisterMessageFilter(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static VisualStudioInterop()
// Already have this process
break;
case "MSBuild":
// If it's msbuild we want to stup up
// If it's msbuild we want to set up
parentDebugProcess = parentDebugProcess.GetParent();
if (parentDebugProcess != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal VisualStudioLogEventSink()

try
{
// TODO: Try to load DTE a at a later point
// TODO: Try to load DTE at a later point
m_dte = VisualStudioInterop.GetDTE();
if (m_dte != null)
{
Expand All @@ -61,7 +61,7 @@ internal VisualStudioLogEventSink()

m_sourceGeneratorOutput ??= m_outputWindow.OutputWindowPanes.Add(outputPanelName);

// When adding a pane will will steal focus, we don't want this. So lets force it back to build
// When adding a pane will steal focus, we don't want this. So lets force it back to build
foreach (OutputWindowPane pane in m_outputWindow.OutputWindowPanes)
{
if(string.Equals(BUILD_OUTPUT_PANE_GUID, pane.Guid))
Expand Down Expand Up @@ -119,7 +119,7 @@ public void Write(string message, OutputWindowPane? outputPain)
}
catch(Exception exception)
{
Console.WriteLine($"Exception was thrown while writing log. Please report this on gihub {exception}");
Console.WriteLine($"Exception was thrown while writing log. Please report this on github {exception}");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SGF
{

/// <summary>
/// Represents a enviroment where the user is authoring code in Visual Studio
/// Represents an environment where the user is authoring code in Visual Studio
/// </summary>
internal class WindowsDevelopmentPlatform : IGeneratorEnvironment
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sandbox/ConsoleApp.SourceGenerator.Tests/TestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private void Compose(string source)
ConsoleAppSourceGeneratorHoist host = new ConsoleAppSourceGeneratorHoist(generator);
// Parse the source into syntax trees
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source);
// Setup the compilation settings
// Set up the compilation settings
CSharpCompilation compilation = CSharpCompilation.Create(
assemblyName: "UniTests",
syntaxTrees: new[] { syntaxTree });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Payload

public ConsoleAppSourceGenerator() : base("ConsoleAppSourceGenerator")
{
WarningMessage = "Warnigs show up in the 'Build' pane along with the 'Source Generators' pane";
WarningMessage = "Warnings show up in the 'Build' pane along with the 'Source Generators' pane";
}

public override void OnInitialize(SgfInitializationContext context)
Expand All @@ -32,7 +32,7 @@ public override void OnInitialize(SgfInitializationContext context)
};

Logger.Warning(WarningMessage);
Logger.Information("This is the output from the sournce generator assembly ConsoleApp.SourceGenerator");
Logger.Information("This is the output from the source generator assembly ConsoleApp.SourceGenerator");
Logger.Information("This generator references Newtonsoft.Json and it can just be referenced without any other boilerplate");
Logger.Information(JsonConvert.SerializeObject(payload));
Logger.Information("Having the log makes working with generators much simpler!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface ILogger
void AddSink(ILogSink sink);

/// <summary>
/// Logs an event the the logger
/// Logs an event to the logger
/// </summary>
/// <param name="logLevel">The level to log</param>
/// <param name="exception">An optional exception that this log refers too</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace SGF.Diagnostics
{
/// <summary>
/// Implemention of a logger with custom sinks
/// Implementation of a logger with custom sinks
/// </summary>
public class Logger : ILogger
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SGF.Diagnostics.Sinks
{
/// <summary>
/// Sink used for outputing events to the console
/// Sink used for outputting events to the console
/// </summary>
public class ConsoleSink : ILogSink
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
namespace SGF
{
/// <summary>
/// Contains information about the enviroment that this source generator is running in. It allows you to
/// star tthe debuggger and get the custom platform loggers based on the context.
/// Contains information about the environment that this source generator is running in. It allows you to
/// star the debugger and get the custom platform loggers based on the context.
/// </summary>
public interface IGeneratorEnvironment
{
Expand Down
6 changes: 3 additions & 3 deletions src/SourceGenerator.Foundations.Contracts/IO/SGFPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class SGFPath
public const char WINDOWS_SEPARATOR = '\\';

/// <summary>
/// The separator used in linux paths
/// The separator used in Linux paths
/// </summary>
public const char LINUX_SEPARATOR = '/';

Expand Down Expand Up @@ -59,7 +59,7 @@ public static bool HasWinRoot(string? path)
}

/// <summary>
/// Determines whether a given path is rooted to linux.
/// Determines whether a given path is rooted to Linux.
/// </summary>
/// <param name="path">The path.</param>
public static bool HasLinuxRoot(string? path)
Expand Down Expand Up @@ -183,7 +183,7 @@ public static bool IsRooted(string? path)
}

/// <summary>
/// Gets the separator char based off the rooted directory, if the path is not rooted we just return the default for the current platofrm.
/// Gets the separator char based off the rooted directory, if the path is not rooted we just return the default for the current platform.
/// </summary>
/// <param name="path">The path.</param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace SGF
{
/// <summary>
/// Used as a base class for creating your own source generator. This class provides some helper
/// methods and impoved debugging expereince. The generator that implements this must apply the
/// <see cref="GeneratorAttribute"/> but not inheirt from <see cref="IIncrementalGenerator"/>
/// methods and improved debugging experience. The generator that implements this must apply the
/// <see cref="GeneratorAttribute"/> but not inherit from <see cref="IIncrementalGenerator"/>
/// </summary>
public abstract class IncrementalGenerator : IDisposable
{
Expand Down Expand Up @@ -60,18 +60,18 @@ protected IncrementalGenerator(string? name)
}

/// <summary>
/// Implement to initalize the incremental source generator
/// Implement to initialize the incremental source generator
/// </ summary >
public abstract void OnInitialize(SgfInitializationContext context);

/// <summary>
/// Override to add logic for disposing this instance and free resources
/// </summary>
protected virtual void Dipose()
protected virtual void Dispose()
{ }

/// <summary>
/// Attaches the debugger automtically if you are running from Visual Studio. You have the option
/// Attaches the debugger automatically if you are running from Visual Studio. You have the option
/// to stop or just continue
/// </summary>
protected void AttachDebugger()
Expand All @@ -81,7 +81,7 @@ protected void AttachDebugger()
}

/// <summary>
/// Raised when one of the generator functions throws an unhandle exception. Override this to define your own behaviour
/// Raised when one of the generator functions throws an unhandled exception. Override this to define your own behavior
/// to handle the exception.
/// </summary>
/// <param name="exception">The exception that was thrown</param>
Expand Down Expand Up @@ -146,7 +146,7 @@ private static IGeneratorEnvironment CreateEnvironment()
/// <inheritdoc cref="IDisposable"/>
void IDisposable.Dispose()
{
Dipose();
Dispose();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SGF
{
/// <summary>
/// Applied a class the inheirts from <see cref="IncrementalGenerator"/>
/// Applied a class that inherits from <see cref="IncrementalGenerator"/>
/// that will have Source Generator Foundations wrapper generated around it. This adds
/// better error handling and logging to the given generator.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace SGF
{
/// <summary>
/// Middleware wrapper around a <see cref="IncrementalGeneratorInitializationContext"/> to allow for
/// wraping with exception handling and provide a better user expereince
/// wrapping with exception handling and provide a better user experience
/// </summary>
public readonly struct SgfInitializationContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct SgfSourceProductionContext


/// <summary>
/// A token that will be cancelled when generation should stop
/// A token that will be canceled when generation should stop
/// </summary>
public CancellationToken CancellationToken => m_context.CancellationToken;

Expand Down
2 changes: 1 addition & 1 deletion src/SourceGenerator.Foundations.Tests/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class BaseTest

protected BaseTest(ITestOutputHelper outputHelper)
{
TestMethodName = "Unkonwn";
TestMethodName = "Unknown";
Type type = outputHelper.GetType();
FieldInfo? testField = type.GetField("test", BindingFlags.Instance | BindingFlags.NonPublic);
ITest? test = testField?.GetValue(outputHelper) as ITest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace SGF.Analyzer.Rules
internal abstract class AnalyzerRule
{
/// <summary>
/// Gets the descritor that this rule creates
/// Gets the descriptor that this rule creates
/// </summary>
public DiagnosticDescriptor Descriptor { get; }

Expand Down Expand Up @@ -68,7 +68,7 @@ protected bool TryGetAttribute(ClassDeclarationSyntax classDeclaration, string n
{
const string POSTFIX = "Attribute";

string alterntiveName = name.EndsWith(POSTFIX, StringComparison.Ordinal)
string alternativeName = name.EndsWith(POSTFIX, StringComparison.Ordinal)
? name.Substring(0, name.Length - POSTFIX.Length)
: $"{name}{POSTFIX}";

Expand All @@ -79,7 +79,7 @@ protected bool TryGetAttribute(ClassDeclarationSyntax classDeclaration, string n
string attributeName = attribute.Name.ToString();

if (string.Equals(attributeName, name, stringComparison) ||
string.Equals(attributeName, alterntiveName, stringComparison))
string.Equals(attributeName, alternativeName, stringComparison))
{
return attribute;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
namespace SGF.Analyzer.Rules
{
/// <summary>
/// Ensures tha the <see cref="GeneratorAttribute"/> is not applied to
/// Ensures that the <see cref="GeneratorAttribute"/> is not applied to
/// <see cref="IncrementalGenerator"/> as these types are not really <see cref="IIncrementalGenerator"/>
/// and won't be pickedup by Roslyn.
/// and won't be picked up by Roslyn.
/// </summary>
internal class ProhibitGeneratorAttributeRule : AnalyzerRule
{
Expand All @@ -28,7 +28,7 @@ protected override void Analyze(ClassDeclarationSyntax classDeclaration)
private static DiagnosticDescriptor CreateDescriptor()
=> new DiagnosticDescriptor("SGF1002",
"Prohibit GeneratorAttribute",
$"{{0}} has the {nameof(GeneratorAttribute)} which can't be applied to classes which are inheirting from the Generator Foundations type {nameof(IncrementalGenerator)}.",
$"{{0}} has the {nameof(GeneratorAttribute)} which can't be applied to classes which are inheriting from the Generator Foundations type {nameof(IncrementalGenerator)}.",
"SourceGeneration",
DiagnosticSeverity.Error,
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void CheckForAttribute(SyntaxNodeAnalysisContext context)
}

/// <summary>
/// Returns back if the type inheirts from <see cref="IncrementalGenerator"/> or not
/// Returns back if the type inherits from <see cref="IncrementalGenerator"/> or not
/// </summary>
/// <param name="typeSymbol">The type to check</param>
/// <returns>True if it does and false if it does not</returns>
Expand Down
6 changes: 3 additions & 3 deletions src/SourceGenerator.Foundations/HoistSourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ private static bool IsSyntaxTargetForGeneration(SyntaxNode s)
private static SourceGeneratorDataModel? GetSemanticTargetForGeneration(GeneratorSyntaxContext context)
{
// we know the node is a ClassDeclarationSyntax thanks to IsSyntaxTargetForGeneration
ClassDeclarationSyntax classDeclrationSyntax = (ClassDeclarationSyntax)context.Node;
ClassDeclarationSyntax classDeclarationSyntax = (ClassDeclarationSyntax)context.Node;

// loop through all the attributes on the method
foreach (AttributeListSyntax attributeListSyntax in classDeclrationSyntax.AttributeLists)
foreach (AttributeListSyntax attributeListSyntax in classDeclarationSyntax.AttributeLists)
{
foreach (AttributeSyntax attributeSyntax in attributeListSyntax.Attributes)
{
Expand All @@ -71,7 +71,7 @@ private static bool IsSyntaxTargetForGeneration(SyntaxNode s)
if (fullName == "SGF.SgfGeneratorAttribute")
{
// return the enum. Implementation shown in section 7.
return SourceGeneratorDataModel.Create(classDeclrationSyntax, context.SemanticModel);
return SourceGeneratorDataModel.Create(classDeclarationSyntax, context.SemanticModel);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ internal class SourceGeneratorDataModel
public string ClassName { get; }
public string Namespace { get; }
public string AccessModifier { get; }
public string QualifedName { get; }
public string QualifiedName { get; }

public SourceGeneratorDataModel(string name, string @namespace, string accessModifier)
{
ClassName = name;
Namespace = @namespace;
AccessModifier = accessModifier;
QualifedName = string.IsNullOrEmpty(Namespace) ? ClassName : $"{Namespace}.{ClassName}";
QualifiedName = string.IsNullOrEmpty(Namespace) ? ClassName : $"{Namespace}.{ClassName}";
}

public static SourceGeneratorDataModel? Create(ClassDeclarationSyntax classDeclarationSyntax, SemanticModel semanticModel)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- ===================== Note =====================
This file is include in all projects that reference
the NuGet packages. Don't references varaibles
the NuGet packages. Don't reference variables
from Directory.Build.[props|targets] as these files
won't exist.
==================================================-->
Expand Down Expand Up @@ -35,7 +35,7 @@
Visible="$(SgfShowImports)">
<Link>SGF/Polyfills/Nullable/%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
<!-- Polyfills: Init Properites-->
<!-- Polyfills: Init Properties-->
<Compile
Include="$(MSBuildThisFileDirectory)..\sgf\src\Polyfills\InitProperties\**\*.cs"
Condition="'$(SgfAddInitPropertyPolyfill.ToLower())' == 'true'"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<!-- ===================== Note =====================
This file is include in all projects that reference
the NuGet packages. Don't references varaibles
the NuGet packages. Don't reference variables
from Directory.Build.[props|targets] as these files
won't exist.
==================================================-->
Expand All @@ -24,7 +24,7 @@
</ItemGroup>
</Target>

<!-- Validates that 'Microsoft.CodeAnalysis.CSharp of any version is referenced -->
<!-- Validates that Microsoft.CodeAnalysis.CSharp of any version is referenced -->
<Target Name="SGF_CodeAnalysisIsReferenced"
BeforeTargets="CoreCompile">
<ItemGroup>
Expand All @@ -38,13 +38,13 @@
<Error Condition="'$(CodeAnalysisPackageVersion)' == ''"
Text="SourceGenerator.Foundations] The project $(MSBuildProjectName) is missing a reference to Microsoft.CodeAnalysis.CSharp of any version. Add a reference to your project to fix this error. https://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp/"/>
</Target>
<!-- Validates they are targeting 'netstandard2.0-->
<!-- Validates they are targeting netstandard2.0-->
<Target Name="SGF_TargetFrameworkValidation" BeforeTargets="CoreCompile"
Condition="'$(TargetFramework)' != 'netstandard2.0'">
<Error
Text="[SourceGenerator.Foundations] The project $(MSBuildProjectName) is currently using the target framework '$(TargetFramework)' which is an error. All source generators must use the target framework 'netstandard2.0'. You can read how to change it here https://learn.microsoft.com/en-us/dotnet/standard/frameworks" />
</Target>
<!-- Validates they are at least using LangVersion 7.3 for nullable refernece types-->
<!-- Validates they are at least using LangVersion 7.3 for nullable reference types-->
<Target Name="SGF_LangVersionValidation" BeforeTargets="CoreCompile">
<ItemGroup>
<NamedVersion Include="preview"/>
Expand Down
Loading

0 comments on commit 37184b5

Please sign in to comment.