-
Notifications
You must be signed in to change notification settings - Fork 928
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
[naga] Comments parsing #6364
base: v22
Are you sure you want to change the base?
[naga] Comments parsing #6364
Conversation
This doesn't get the comments out of the front end, though, does it? It seems to me it could be fine to just add a field like: doc_comments: Option<Box<DocComments>>, to struct DocComments {
types: FastIndexMap<Handle<Type>, Vec<Span>>,
global_variables: FastIndexMap<Handle<GlobalVariable>, Vec<Span>>,
...
} I think it would make sense for Naga to adopt Rust's |
Correct, I'm looking into propagating them to the module now ; my first intuition was to add comments to Your idea of a "flat" |
Connections
None as far as I know.
Description
Generating automated documentation à la https://docs.rs is very useful, but currently difficult.
naga lacks information about comments to be too helpful, so this pull requests adds support to parsing those.
Note: I branched off 0.22 because I'm not confident with jumping on the maybe unstable trunk.
Testing
Not much for now, I'm compiling a currently private project based on https://github.com/jannik4/shader_docs to attempt to add documentation strings to it.
Status
Comment
//
comments/* */
commentsast::Struct
//!
.naga::Module
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.Test failures
Reminder: I'm branched off tag
wgpu-v22.1.0
, which had mopre flaky tests.New failing tests
shader_compile_error
seems expected as it explicitly handles comments, so we probably want to change the test,but I'm out of my comfort zone to make more analysis, so I'd appreciate instructions :)
CHANGELOG.md
. See simple instructions inside file.