bevyengine / bevyengine/bevy

Add advice on VSCode setup to get syntax highlighting working for Bevy-flavored shaders

Open
#5,561 6 comments 8 reactions 0 assignees View on GitHub
A-Rendering C-Docs D-Trivial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## How can Bevy's documentation be improved?

@jakobhellermann [explains](https://discord.com/channels/691052431525675048/730525730601041940/1004370971869860000) how to do this.

>If you're using wgsl-analyzer you can define some custom imports in the vscode settings
> But you'll have to find all wgsl files and specify their import paths manually
> https://github.com/wgsl-analyzer/wgsl-analyzer/tree/main/editors/code#custom-imports

```json
{
"wgsl-analyzer.customImports": {
"bevy_pbr::clustered_forward": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/clustered_forward.wgsl",
"bevy_pbr::mesh_bindings": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/mesh_bindings.wgsl",
"bevy_pbr::mesh_functions": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/mesh_functions.wgsl",
"bevy_pbr::mesh_types": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/mesh_types.wgsl",
"bevy_pbr::mesh_vertex_output": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/mesh_vertex_output.wgsl",
"bevy_pbr::mesh_view_bindings": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/mesh_view_bindings.wgsl",
"bevy_pbr::mesh_view_types": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/mesh_view_types.wgsl",
"bevy_pbr::pbr_bindings": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/pbr_bindings.wgsl",
"bevy_pbr::pbr_functions": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/pbr_functions.wgsl",
"bevy_pbr::lighting": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/pbr_lighting.wgsl",
"bevy_pbr::pbr_types": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/pbr_types.wgsl",
"bevy_pbr::shadows": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/shadows.wgsl",
"bevy_pbr::skinning": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/skinning.wgsl",
"bevy_pbr::utils": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_pbr/src/render/utils.wgsl",
"bevy_sprite::mesh2d_bindings": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_sprite/src/mesh2d/mesh2d_bindings.wgsl",
"bevy_sprite::mesh2d_functions": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_sprite/src/mesh2d/mesh2d_functions.wgsl",
"bevy_sprite::mesh2d_types": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_sprite/src/mesh2d/mesh2d_types.wgsl",
"bevy_sprite::mesh2d_vertex_output": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_sprite/src/mesh2d/mesh2d_vertex_output.wgsl",
"bevy_sprite::mesh2d_view_bindings": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_sprite/src/mesh2d/mesh2d_view_bindings.wgsl",
"bevy_sprite::mesh2d_view_types": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/crates/bevy_sprite/src/mesh2d/mesh2d_view_types.wgsl",
}
}
```

Generated with:

```sh
rg define_import_path -g '*.wgsl' --sort path | sd '^([^:]*):#define_import_path (.*)' ' "$2": "https://raw.githubusercontent.com/bevyengine/bevy/v0.8.0/$1",'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.