Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Line Endings #14

Closed
SMAH1 opened this issue Dec 4, 2024 · 2 comments
Closed

Inconsistent Line Endings #14

SMAH1 opened this issue Dec 4, 2024 · 2 comments

Comments

@SMAH1
Copy link

SMAH1 commented Dec 4, 2024

Windows 10 22H2
Visual Studio: Community 2202 17.12.2
dotnet project: 8.0
ServiceScan.SourceGenerator: 1.2.5

Hi
I config:

    [GenerateServiceRegistrations(
    TypeNameFilter = "AAA.Singleton.*Service",
    AsImplementedInterfaces = true,
    Lifetime = ServiceLifetime.Singleton
    )]
    public static partial IServiceCollection AutomaticallyAddSingletonServices(this IServiceCollection services);

result is:

using Microsoft.Extensions.DependencyInjection;

namespace AAA;

public static partial class AutomaticallyAddService
{
    public static partial IServiceCollection AutomaticallyAddSingletonServices(this IServiceCollection services)
    {
        return services
            .AddSingleton<AAA.Singleton.IUuidV7Service, AAA.Singleton.UuidV7Service>()
            .AddSingleton<AAASingleton.IDateTimeService, AAA.Singleton.DateTimeService>();
    }
}

and compile source, everything is OK.
but when open source file is generated, see warning:
image

this warning show when use '\n' instance of '\r\n'.
NOTE: Generated file must have two or more services added.

@Dreamescaper
Copy link
Owner

This issue is quite annoying. While it should be possible to generate consistant endings, VS shouldn't care at all about such things for generated files.
You can upvote this Roslyn bug:
dotnet/roslyn#54633

@Dreamescaper
Copy link
Owner

Fixed in scope of #15 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants