Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An extra space is added after SynType.StaticConstantExpr #2101

Open
3 tasks
auduchinok opened this issue Feb 16, 2022 · 3 comments
Open
3 tasks

An extra space is added after SynType.StaticConstantExpr #2101

auduchinok opened this issue Feb 16, 2022 · 3 comments

Comments

@auduchinok
Copy link
Contributor

Issue created from fantomas-online

Code

type T = Provider< @"...">

Result

type T = Provider< @"..." >

Problem description

An extra space is added after the literal, but, unlike the preceding one, it's not required by syntax. When there're multiple args, the extra space is not added:

type T = Provider<1, @"...">

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas master branch at 1/1/1990 // @nojaf Is this a correct version?

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

@nojaf
Copy link
Contributor

nojaf commented Feb 16, 2022

Hello, this appears to be introduced in #859.
This predates the style guide, so I'd like to so see an outcome over there first what to do with this.
There is as much reason not to add the space as to add it I guess.

@auduchinok
Copy link
Contributor Author

We don't add spaces to any of type arguments, unless they can't be parsed:

T<int>
T<a * b>
T<_>
T<"123">
T<1, Qwerty, @"123">

The T< @""> case is special just due to <@ is tokenized as an operator instead of separate tokens, so this is why space is required in this specific case.

@nojaf
Copy link
Contributor

nojaf commented Feb 16, 2022

You could still make the argument that, if you have the special case, you need to add a space before and after. There is nothing wrong with adding the extra space.
Please just get it in the guide. If we were to change this now, somebody in the future will then open an issue that it changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants