Added support for .wesl files to the regex pattern for examples (#19178)

## Objective

[Shaders / Material -
WESL](https://bevyengine.org/examples-webgpu/shaders/shader-material-wesl/)
example doesn't have a WESL file tab


## Solution

 Added wesl to regex

---------

Co-authored-by: Stepan Urazov <110625288+hg127@users.noreply.github.com>
This commit is contained in:
Stepan Urazov 2025-05-26 20:52:59 +03:00 committed by François Mockers
parent 489dca774c
commit 27221622b0

View File

@ -773,9 +773,7 @@ fn parse_examples() -> Vec<Example> {
let technical_name = val.get("name").unwrap().as_str().unwrap().to_string(); let technical_name = val.get("name").unwrap().as_str().unwrap().to_string();
let source_code = fs::read_to_string(val["path"].as_str().unwrap()).unwrap(); let source_code = fs::read_to_string(val["path"].as_str().unwrap()).unwrap();
let shader_regex = let shader_regex = Regex::new(r"shaders\/\w+\.(wgsl|frag|vert|wesl)").unwrap();
Regex::new(r"(shaders\/\w+\.wgsl)|(shaders\/\w+\.frag)|(shaders\/\w+\.vert)")
.unwrap();
// Find all instances of references to shader files, and keep them in an ordered and deduped vec. // Find all instances of references to shader files, and keep them in an ordered and deduped vec.
let mut shader_paths = vec![]; let mut shader_paths = vec![];