• Stars
    star
    134
  • Rank 269,734 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

C# Source Generator for UTF-8 binary literal

C# StringLiteralGenerator

A C# Source Generator for optimizing UTF-8 binaries.

Original source (manually written):

namespace Sample
{
    partial class Literals
    {
        [StringLiteral.Utf8Attribute("aฮฑใ‚๐Ÿ˜Š")]
        public static partial System.ReadOnlySpan<byte> S();
    }
}

Generated source:

namespace Sample
{
    partial class Literals
    {
        public static partial System.ReadOnlySpan<byte> S() => new byte[] {97, 206, 177, 227, 129, 130, 240, 159, 152, 138, };
    }
}

NuGet

NuGet

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net5.0</TargetFramework>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="StringLiteralGenerator" Version="1.0.0" />
    </ItemGroup>

</Project>

For versions earlier than .NET 5 SDK RC2 you may also need to add a reference to Microsoft.Net.Compilers.Toolset. So the csproj may look like this:

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net5.0</TargetFramework>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="StringLiteralGenerator" Version="1.0.0-preiew" />
        <PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.8.0-4.final" PrivateAssets="all" />
    </ItemGroup>

</Project>

More Repositories

1

UfcppSample

http://ufcpp.net/ ๅ‘ใ‘ใฎใ‚ตใƒณใƒ—ใƒซ
C#
132
star
2

GraphemeSplitter

A C# implementation of the Unicode grapheme cluster breaking algorithm
C#
47
star
3

ContextFreeTask

Task-like structs which capture no synchronization context on the await operations.
C#
36
star
4

BitFields

C#
22
star
5

ValueChangedGenerator

Roslyn Code Fix / Source Generator for generating PropertyChanged from inner struct members.
C#
11
star
6

ScribanSourceGenerator

C#
7
star
7

UnityTools

Miscellaneous tools for Unity Game Engine.
C#
7
star
8

MixinGenerator

A Code-Aware library for giving additional functionality by composition-over-inheritance, a mixin-like approach.
C#
7
star
9

MemberAccessGenerator

C#
6
star
10

SqlToCsharp

A C# class generator from SQL CREATE TABLE Statements (SSDT)
C#
5
star
11

RecordConstructorGenerator

Roslyn Code Fix for a record (immutable class/struct) constructor generated from get-only properties.
C#
5
star
12

UnitySamples

Unity 5.5 sample with async/await
C#
5
star
13

dotnet-ExtractUnityPackage

A dotnet global tool for extracting .unitypackage
C#
5
star
14

RemoveOnly

Removes "Only" from DateOnly/TimeOnly structs.
C#
4
star
15

AwaitableUniRx

IAsyncMethodBuilder portability libarary on UniRx and Awaitable extensions for UniRx
C#
4
star
16

InternalReservedAttributeContent

A source code package of C# reserved attributes with internal accessibility
C#
4
star
17

TextTemplateSourceGenerator

Text Template Preprocessor by C# Source Generator
C#
3
star
18

BitFieldGenerator

Roslyn Code Fix provider for metaprogramming to generate bit fields
C#
3
star
19

TupleExtensions

Extension methods for tuple features in C# 7
C#
3
star
20

connect-japan-2018

C#
3
star
21

emoji

C#
3
star
22

StringInterpolation

C#
3
star
23

LinqToArray

Optimized subset of LINQ operators dedicated to arrays
C#
2
star
24

UnicodeDataCsharp

Parsing UCD in C#
C#
2
star
25

UfcppUtils

Utilities for reflection, expression trees, dynamic features.
C#
2
star
26

RoslynCsharpToHtml

copy C# source codes as HTML with Roslyn
C#
2
star
27

InternalReservedAttributeGenerator

A C# Source Generator for generating C# reserved attributes with internal accessibility.
C#
2
star
28

StaticWebApps

C#
2
star
29

MsbuildAll

ใƒชใƒใ‚ธใƒˆใƒชๅ†…ใฎ sln ใซๅฏพใ—ใฆ NuGet restore ใจ msbuild ใ‚’ๆŽ›ใ‘ใฆๅ›žใ‚‹ใ‚นใ‚ฏใƒชใƒ—ใƒˆใ€‚
C#
2
star
30

Utf8Utils

ArraySegment ๅ‰ๆ UTF8 ๆ–‡ๅญ—ๅˆ—ๆ“ไฝœ
C#
2
star
31

UfcppJupyter

dotnet try jupyter notebooks
Dockerfile
1
star
32

AnalyzerConvention

"Analyzer with Code Fix" project template with ConventionCodeFixVerifier test project
C#
1
star
33

RandomString

C# random string generator
C#
1
star
34

DelegateInterface

C#
1
star
35

CanDoVS2015

ใงใใ‚‹Visual Studio 2015ๅ‘ใ‘
Java
1
star
36

TryGithubActions

C#
1
star
37

ConventionCodeFixVerifier

C#
1
star
38

DotNetConf2023Recap

.NET Conf 2023 Recap Japan ใ€Œ้–‹็™บใƒ„ใƒผใƒซใฎๆœ€ๆ–ฐใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆใ€ๅ‘ใ‘
1
star