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

CSharpier deletes arguments of primary constructor on struct #1067

Open
superdweebie opened this issue Dec 11, 2023 · 6 comments
Open

CSharpier deletes arguments of primary constructor on struct #1067

superdweebie opened this issue Dec 11, 2023 · 6 comments

Comments

@superdweebie
Copy link

public struct Test(string arg1)
{
    public string Arg1 { get; } = arg1;
}

becomes:

public struct Test
{
    public string Arg1 { get; } = arg1;
}
@superdweebie
Copy link
Author

I've had to turn CSharpier off after migrating to .Net 8 due to this issue.

@belav belav added this to the 0.26.6 milestone Dec 12, 2023
@belav
Copy link
Owner

belav commented Dec 12, 2023

Sorry about missing that primary constructor case, I can hopefully get a fix out today after work.

@superdweebie
Copy link
Author

Thanks for sharing your work with the world. No stress from me.

@belav
Copy link
Owner

belav commented Dec 13, 2023

It looks like this did make it into 0.26.0, are you perhaps on an older version?

See #969

@superdweebie
Copy link
Author

I installed via Visual Studio Extensions. It says I have version 1.4.8. It also says there are no updates available. Should I install via command line instead?

@belav
Copy link
Owner

belav commented Dec 14, 2023

The extension is versioned separately from CSharpier itself. People working on multiple projects with teams may have each project on a different version of csharpier.

You probably are using the version of CSharpier that was available when you installed the extension. Figuring out a way to show that info to the user and/or a way to update CSharpier from the extension has been on my list for a while but I haven't had time to get to it.

Assuming you have it installed globally you can run
dotnet tool update -g csharpier
Then restart the IDE, it caches some information about what version of csharpier to use for files in directories.

@belav belav removed this from the 0.26.6 milestone Dec 16, 2023
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