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

Validate manifests #2

Open
itowlson opened this issue Feb 21, 2022 · 3 comments
Open

Validate manifests #2

itowlson opened this issue Feb 21, 2022 · 3 comments

Comments

@itowlson
Copy link
Collaborator

Tracking issue for possible validations e.g.

  • Are all required fields present?
  • Does the source file exist?
  • Does the files array contain any patterns that match no files?
@itowlson
Copy link
Collaborator Author

The "Even Better TOML" extension allows validating TOML against a JSON schema, which would achieve what we need, but doesn't yet have a way for an extension to register schemas. I've raised an issue and got a positive response, but they're not in a position for external contributors to send PRs right now; discussing it with the maintainer though.

@radu-matei
Copy link
Member

What if we had a Spin command that did some of this work?
It wouldn't have to be as accurate as a "language server" (i.e squiggles on specific lines, although that would be cool), but it could be able to validate a particular manifest.

@itowlson
Copy link
Collaborator Author

itowlson commented Jun 9, 2022

If it gave source file locations where appropriate, that would be great, but as you imply, the current architecture wouldn't give us that, because Spin uses serde deserialisation which does not retain position information. Without that, we could produce a problems list, but it wouldn't be very idiomatic. In VS Code the user expects squigglies, and expects to be able to click on a problem in the list and get taken to the location...

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

No branches or pull requests

2 participants