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

Regal's parser should be made schema-aware #712

Open
anderseknert opened this issue May 10, 2024 · 2 comments
Open

Regal's parser should be made schema-aware #712

anderseknert opened this issue May 10, 2024 · 2 comments

Comments

@anderseknert
Copy link
Member

Having schemas to define things like the input document is a great way to prevent typos and mistakes that would otherwise only be caught at runtime. The opa check command allows providing a --schema directory, but there's no corresponding option for Regal.

Screenshot pictures a type error from typing an invalid input reference. This is caught by the "check on save" feature, but not by Regal so the error isn't inlined.

Screenshot 2024-05-10 at 15 42 40

We should allow pointing out a schema directory via .regal/config.yaml and provide that to the parse if found.

@anderseknert
Copy link
Member Author

Tagging this "language server protocol" but this should benefit linting from the CLI as well.

@anderseknert
Copy link
Member Author

This could also be used for code completions when provided, so that typing inp (or input., whatever) would bring up suggestions based on the possible attributes from the schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: TODO
Development

No branches or pull requests

1 participant