Skip to content

Add SyntaxVisitorBase tutorial #15938

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

Merged
merged 5 commits into from
Sep 7, 2023
Merged

Add SyntaxVisitorBase tutorial #15938

merged 5 commits into from
Sep 7, 2023

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Sep 6, 2023

Adds a bit of prose about the SyntaxVisitorBase.
Since I'm still new to this, I would greatly value feedback from those who have more experience with it.

@nojaf nojaf requested a review from a team as a code owner September 6, 2023 13:19
Copy link
Contributor

@dawedawe dawedawe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some tiny wording stuff from me.

Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff. Useful for me as well. Thanks!

What I was curious about when working with this myself, was why we have this particular set of methods to override in the SyntaxVisitorBase thing.

For example we have these FSharpFileParseResults where we - as much as I feel understand - basically build contraptions of top of the SyntaxVisitorBase. Like, why isn't there a builtin thing like VisitAnonRecord or VisitTypeDefinition?

You know, everything I always wanted to know about SyntaxVisitorBase but was afraid to ask :D

@nojaf
Copy link
Contributor Author

nojaf commented Sep 7, 2023

Thanks for the reviews everyone!

Like, why isn't there a builtin thing like VisitAnonRecord or VisitTypeDefinition

I'm not sure but I think SyntaxVisitorBase grows a bit organically as FCS users need new things.
My call to action in #15930 was really having the use case that I wanted to find a val in a signature file.

@T-Gro T-Gro enabled auto-merge (squash) September 7, 2023 08:22
@T-Gro T-Gro merged commit 5f59fa1 into dotnet:main Sep 7, 2023
@psfinaki
Copy link
Member

psfinaki commented Sep 7, 2023

Alright, I think it's very helpful as of now, we can later add more tips there :)

I'm not sure but I think SyntaxVisitorBase grows a bit organically as FCS users need new things.

Yeah probably we can later add some guidance on when & how to add some stuff to the SyntaxVisitorBase.

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

Successfully merging this pull request may close these issues.

4 participants