Skip to content

Expose TypeAlias and TypeVar related structs in rust library#1274

Merged
zsol merged 1 commit intoInstagram:mainfrom
Crozzers:expose-typevar-structs
Jan 8, 2025
Merged

Expose TypeAlias and TypeVar related structs in rust library#1274
zsol merged 1 commit intoInstagram:mainfrom
Crozzers:expose-typevar-structs

Conversation

@Crozzers
Copy link
Contributor

@Crozzers Crozzers commented Jan 8, 2025

Summary

This PR re-exports a number of structs related to type aliases and type vars in the rust library. The use case for this is making it easier to traverse a parsed Module.

You can traverse SmallStatement::TypeAlias(value) => value.type_parameters[0].param all without directly referring to those types (ie: not needing to import them) but TypeParam.param is an enum. You can't do much with that without matching against the enum values to determine the actual type, which requires them to be imported.

Test Plan

Tested locally and was able to use the new exports.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 8, 2025
@zsol
Copy link
Contributor

zsol commented Jan 8, 2025

Thanks!

@zsol zsol merged commit 595d7f6 into Instagram:main Jan 8, 2025
jorenham pushed a commit to jorenham/LibCST that referenced this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants