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

Add TypedSyntaxNode::cast and Terminal::cast_token methods #7044

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

mkaput
Copy link
Collaborator

@mkaput mkaput commented Jan 10, 2025

The pattern of checking for node kind and them calling panicking from_syntax_node is pretty common and these little methods could simplify a lot of code. I took the name from Rust Analyzer's codebase.

@mkaput mkaput requested review from orizi and wawel37 as code owners January 10, 2025 11:23
@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 7 of 7 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @wawel37)

@mkaput mkaput changed the title Add TypedSyntaxNode::cast method Add TypedSyntaxNode::cast and Terminal::cast_token methods Jan 10, 2025
@mkaput mkaput added this pull request to the merge queue Jan 10, 2025
Merged via the queue into main with commit baee641 Jan 10, 2025
48 checks passed
@mkaput mkaput deleted the mkaput/cast-syntax-node branch January 10, 2025 12: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

Successfully merging this pull request may close these issues.

3 participants