From 0d3426a2e88709175f545b4caf74eb2c54bee79a Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sun, 3 Nov 2024 21:13:52 -0800 Subject: fix(wgsl): indent first parameter of function definition --- tests/indent/wgsl/basic.wgsl | 17 +++++++++++++++++ tests/indent/wgsl_spec.lua | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'tests/indent') diff --git a/tests/indent/wgsl/basic.wgsl b/tests/indent/wgsl/basic.wgsl index 7dd50f87e..ccf29a360 100644 --- a/tests/indent/wgsl/basic.wgsl +++ b/tests/indent/wgsl/basic.wgsl @@ -41,3 +41,20 @@ fn vertex(vertex: Vertex, out.b = 2; return out; } + +fn foo( + a: u32, + b: u32, +) { + return a; +} + +fn bar( +) {} + +fn baz( + a: u32, +) {} + +fn qux( +) diff --git a/tests/indent/wgsl_spec.lua b/tests/indent/wgsl_spec.lua index 55d59acbd..e70215a7b 100644 --- a/tests/indent/wgsl_spec.lua +++ b/tests/indent/wgsl_spec.lua @@ -15,5 +15,10 @@ describe("indent WGSL:", function() }) end) - describe("new line:", function() end) + describe("new line:", function() + run:new_line("basic.wgsl", { on_line = 47, text = "c: u32,", indent = 2 }) + run:new_line("basic.wgsl", { on_line = 52, text = "c: u32,", indent = 2 }) + run:new_line("basic.wgsl", { on_line = 56, text = "c: u32,", indent = 2 }) + run:new_line("basic.wgsl", { on_line = 59, text = "c: u32,", indent = 2 }) + end) end) -- cgit v1.2.3-70-g09d2