You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…ion (#5303)
# 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:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.
# PR Checklist\*
- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
Aim
I want to be able to format the following bad function:
Expected Behavior
I expect the following formatted function from the above:
Bug
Instead I get this:
To Reproduce
nargo fmt
Project Impact
Nice-to-have
Impact Context
Complicates being able to write more complex formatting tests.
Workaround
None
Workaround Description
The workaround is to simply not have any spaces before declaring generics in a function which is not ideal.
Additional Context
No response
Installation Method
Compiled from source
Nargo Version
noirc version = 0.31.0+4a1f8992f5296bc38505fba8e98d9fd3a4264c97
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: