-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add full glTF Validator integration #27
Comments
Someday it would be great to run validation as part of a custom glTF Language Server. https://code.visualstudio.com/blogs/2016/06/27/common-language-protocol https://code.visualstudio.com/docs/extensions/example-language-server |
@emackey
|
On that first point, this extension already depends on an npm package called json-source-map, and we use it to get a JSON pointer to a data-URI that the user has clicked on in the text editor. Their API Docs specifically mention RFC 6901. |
Would be nice to break out different diagnostic severities, as discussed in KhronosGroup/glTF-Validator#21 (comment) |
I got a first cut of this working last night on the |
Since both VS Code glTF Server and glTF Validator JS API are in pre-release stage, let's establish best practices for their integration. Here're my first comments on server.ts as of 075d660.
|
@lexaknyazev Thanks for the pre-PR review! I do have plans to add a GLB validation command, especially now that VSCode itself can produce new GLB files, it's needed. Perhaps newly-produced GLBs should auto-validate. I'll look into the other comments here too. |
@lexaknyazev Is there a way I can manually trigger the "Validator had problems" failure path? Would like to test how VSCode handles those failures. |
Try to feed it with nor glTF, neither GLB data. |
I talked briefly with @lexaknyazev about this at the glTF roadmap meeting after SIGGRAPH 2017. Basically, this extension is using VSCode's built-in JSON validator against the glTF schema, but there are lots (dozens, hundreds?) of types of glTF errors (such as binary range out-of-bounds, etc) that can't be caught by simple JSON schema validation alone. To catch these, we should instead run the official glTF Validator from Khronos.
The official validator is written in Dart, and I believe has already been compiled to JS. @lexaknyazev mentioned that an npm package was going to be released soon, and that we could include that as a dependency.
Letting go of VSCode's JSON validation and switching to a custom validator will have some complexity on the VSCode integration side as well. I've looked into it, but it's not immediately clear to me the best path forward. @balefrost expressed some interest, but doesn't have any time to work on this last I checked.
Contributions here are most welcome!
The text was updated successfully, but these errors were encountered: