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

[Feat]: Provide semantic item and type information for dependencies #266

Open
xFrednet opened this issue Oct 1, 2023 · 0 comments
Open
Labels
A-api Area: Stable API C-enhancement Category: New feature or request

Comments

@xFrednet
Copy link
Member

xFrednet commented Oct 1, 2023

Summary

Rustc splits the compilation of a project into multiple compilation units, called crates. This means, that at a given time, rustc only has access to the AST of a single crate. Therefore, it can happen that the AST representation of a node is unavailable, even if the ID is valid. Due to the fact, that the item comes from a dependency.

Even if there is no AST representation, there is usually some semantic information available. This is required for type checking and name resolution, among other things. There are a few key differences, which prevent Marker from turning this semantic information into an AST representation. For example, there are no spans or bodies. The information how an item was created is simply lost, as it's not required for dependents.

This issue suggests the addition of semantic item and type information. Every valid ItemId or TyDefId should have valid semantic information available, even if the AST node isn't available. This concept also extends to other AST nodes like EnumVariants etc.

@xFrednet xFrednet added C-enhancement Category: New feature or request A-api Area: Stable API labels Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Area: Stable API C-enhancement Category: New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant