noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
821 stars 177 forks source link

fix(nargo_fmt): Account for spaces before the generic list of a function #5303

Closed vezenovm closed 1 week ago

vezenovm commented 1 week ago

Description

Problem*

Resolves #5300

Summary*

Previously the formatter was inserting an extra < when formatting functions with a space before < when specifying generics. We currently mark the starting span for a list of generics as the end of the function name. Having this be the starting span would cause the first generic of the sequence to have < marked as a leading string when it should not have been. We now start the span for a function's generics by looking for < rather than starting the span at the end of the function name.

Additional Context

Documentation*

Check one:

PR Checklist*