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

$Classes cannot find record classes #337

Open
KeithHenry opened this issue Dec 15, 2020 · 13 comments
Open

$Classes cannot find record classes #337

KeithHenry opened this issue Dec 15, 2020 · 13 comments

Comments

@KeithHenry
Copy link

C#9 introduces record as a immutable class, with a new terse syntax.

So instead of:

public class Person {
    public Person(string name) { this.Name = name; }
    public string Name { get; private set; }
}

We can now do:

public record Person(string Name);

This creates a special class that is read only and has built-in value equality.

Unfortunately $Classes cannot find any of these record classes, and there doesn't appear to be any way to include them in template output.

Either:

  • $Classes should find both class and record definitions, or...
  • $Records should be a new base iterator that goes through record definitions.
@dperetz1
Copy link

any workaround?

@AdaskoTheBeAsT
Copy link

I forked sources and started to work on this - is seems it cannot be realised by CodeDom but only Roslyn (or I am wrong ;)).
when I will have some working code a I will release it as some unofficial fork

@dperetz1
Copy link

dperetz1 commented Jan 9, 2021

I forked sources and started to work on this - is seems it cannot be realised by CodeDom but only Roslyn (or I am wrong ;)).
when I will have some working code a I will release it as some unofficial fork

Cool, thanks. why not making a PR to the official repo?

@AdaskoTheBeAsT
Copy link

it seems that Fredrik is quite busy - my last PR is waiting for more than a year #322

@AdaskoTheBeAsT
Copy link

@dperetz1
Copy link

Unofficial release
https://github.com/AdaskoTheBeAsT/Typewriter/releases/tag/1.30.0

Thank you very much 😃 . I'm sorry if it's a dumb question but - @frhagn, although you're probably busy, I think it's quite important - would you accept a PR for it? (so it will be official)

@s4m0r4m4
Copy link

@AdaskoTheBeAsT - I have had a similar experience that the repo owner is busy and non-responsive, no judgement from me, it happens. If you were interested in hosting a "v2" repo, I would be able to support and help gather other open-source developers - I've seen a lot of interest from others on this repo in getting a new version off the ground and I'd be happy to help direct them to your repo if you'd like to use it for an official v2 and accept PRs from others.

@luizfbicalho
Copy link

I would try to help too

@AdaskoTheBeAsT
Copy link

Ok let me try - I am thinking if it still need to be done as vsix or there is possibility to incorporate new source generator thingy

@s4m0r4m4
Copy link

Sounds good. I would recommend setting up a repo (or using your fork) just to release a new version of the vsix (seems like you've basically already got that), and then you can work on moving towards a different tech stack.

There was some good discussion on this thread: #317 about the possibility of moving to a compile-time setup using Source Generators, or perhaps even an npm script. That being said, I think just getting a functional repo again that uses the same .tst syntax would be a huge win and you could go from there.

@johnknoop
Copy link

Great to see someone making this effort. I've evaluated a bunch of other C#->TS generators, but none come close in terms of customizability, and it's a shame that the project is effectively abandoned.

If you could modernize it in the ways mentioned by @s4m0r4m4 and perhaps remove the dependency on Visual Studio (a lot of folks just use VS Code nowadays) it would be even better, but as you state, getting a live repository up and running is a great step in the right direction.

@s4m0r4m4
Copy link

s4m0r4m4 commented Feb 6, 2021

@AdaskoTheBeAsT any luck setting up a new repo? I'd love to contribute

@AdaskoTheBeAsT
Copy link

hi sorry I am in the middle of changing job right now - it will take some time...

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

6 participants