rust-peg icon indicating copy to clipboard operation
rust-peg copied to clipboard

Add allow omit rule `=`

Open A4-Tacks opened this issue 6 months ago • 2 comments

This PR makes = ... optional for easy completion

rule x() -> cannot trigger completion, rule x() -> = can

A4-Tacks avatar Jun 11 '25 01:06 A4-Tacks

By "completion" do you mean allowing the macro expansion to generate enough output so that rust-analyzer can provide suggestions for the return type?

This would allow mistakes to be successfully compiled. Instead of fully allowing this, would it work to expand it to something like rule x() -> ty = { compile_error!("missing rule body") } such that rustc won't compile it, but rust-analyzer can still see the ty you've started typing?

kevinmehall avatar Jun 16 '25 00:06 kevinmehall

Good idea!

A4-Tacks avatar Jun 16 '25 02:06 A4-Tacks

r? @kevinmehall

A4-Tacks avatar Jul 23 '25 02:07 A4-Tacks

Thanks!

kevinmehall avatar Aug 03 '25 20:08 kevinmehall