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

[style-guide] space around SynType.StaticConstantExpr #657

Open
nojaf opened this issue Mar 4, 2022 · 3 comments
Open

[style-guide] space around SynType.StaticConstantExpr #657

nojaf opened this issue Mar 4, 2022 · 3 comments

Comments

@nojaf
Copy link
Contributor

nojaf commented Mar 4, 2022

Considering the following code:

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

There needs to be a space before the @ string in order for this to remain valid code.
Should there be a space after the literal in this case?

As mentioned by @auduchinok in fsprojects/fantomas#2101, all other types of arguments do not need a space:

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

What guidance should there be regarding type arguments @dsyme? I don't the guide currently has any information on the subject.

Side note:
Fantomas currently adds the extra space when a leading space is required.
I personally don't have any preference or stake here, I only want a change in Fantomas because the style guide changed.
That is why I'm bringing this up.

@dsyme
Copy link
Contributor

dsyme commented Mar 4, 2022

Should there be a space after the literal in this case?

Aesthetically yes, I guess it would be good. We should also just fix the problem that doesn't allow <@ in that position.

@cartermp
Copy link
Member

cartermp commented Mar 4, 2022

Yeah, I see this as a parser bug and not a stylistic choice.

@dsyme
Copy link
Contributor

dsyme commented May 26, 2022

Until a fix is made, there should indeed be a space after the literal in this case.

@nojaf I don't think we need a style guide update for this corner case, we can take this issue as the clarification.

Thanks!

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

3 participants