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(apollo-compiler): create diagnostics with source spans #251

Merged
merged 12 commits into from
Jul 13, 2022

Conversation

lrlna
Copy link
Member

@lrlna lrlna commented Jul 13, 2022

This PR introduces diagnostics to apollo-compiler. Given SyntaxNode information we have from apollo-parser, we are able to store that information in compiler's Values and create proper source spans.

We are using miette to create diagnostics. Graphical display that miette provides is only available with Display. This means diagnostics can be used in myriads of other use cases that might not need the graphical interface (e.g. wasm).

(almost) all values in apollo-compiler store a pointer back to the AST which can be accessed with ast_node() getter methods.

@lrlna lrlna added the apollo-compiler issues/PRs pertaining to semantic analysis & validation label Jul 13, 2022
@lrlna lrlna self-assigned this Jul 13, 2022
@lrlna lrlna force-pushed the compiler-error-spans branch from 25892a6 to 4defb6a Compare July 13, 2022 13:51
@lrlna lrlna merged commit ec0dd58 into main Jul 13, 2022
@lrlna lrlna deleted the compiler-error-spans branch July 13, 2022 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apollo-compiler issues/PRs pertaining to semantic analysis & validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant