-
-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Windowing 3.0 for real this time
- Loading branch information
Showing
60 changed files
with
2,693 additions
and
3,287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Reflection; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Silk.NET.Core.Analyzers; | ||
|
||
/// <summary> | ||
/// Helpers used in the construction of Silk.NET's analyzers and generators. | ||
/// </summary> | ||
public static class Helpers | ||
{ | ||
/// <summary> | ||
/// Registers sources embedded in the calling assembly with the given embedded resource names as post-initialization | ||
/// output. | ||
/// </summary> | ||
/// <param name="ctx">The generator context.</param> | ||
/// <param name="embeddedResourceNames">The embedded resource names.</param> | ||
public static void RegisterPostInitializationEmbeddedSource( | ||
this IncrementalGeneratorInitializationContext ctx, | ||
params string[] embeddedResourceNames | ||
) | ||
{ | ||
var caller = Assembly.GetCallingAssembly(); | ||
ctx.RegisterPostInitializationOutput(x => | ||
{ | ||
foreach (var res in embeddedResourceNames) | ||
{ | ||
using var stream = caller.GetManifestResourceStream(res); | ||
if (stream is null) | ||
{ | ||
continue; | ||
} | ||
using var sr = new StreamReader(stream); | ||
x.AddSource(res, sr.ReadToEnd()); | ||
} | ||
}); | ||
} | ||
} |
1,030 changes: 0 additions & 1,030 deletions
1,030
sources/Core/Analyzers/HluSourceGenerator.Hosts.cs
This file was deleted.
Oops, something went wrong.
842 changes: 0 additions & 842 deletions
842
sources/Core/Analyzers/HluSourceGenerator.Registries.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Silk.NET.Core.Analyzers; | ||
|
||
/// <summary> | ||
/// An attribute that triggers <c>StaticAbstractInterfaceMocking</c> to generate a mock. | ||
/// </summary> | ||
internal class MockStaticAbstractAttribute : Attribute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.