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

Spaces inside function calls #1023

Open
lhunath opened this issue Oct 5, 2021 · 0 comments
Open

Spaces inside function calls #1023

lhunath opened this issue Oct 5, 2021 · 0 comments

Comments

@lhunath
Copy link

lhunath commented Oct 5, 2021

It would be great to have the option to insert spaces inside function call parenthesis (matching AppCode's Method/function call parenthesis option).

@available( *, unavailable, renamed: "M" )
func foo() {}

bar( name: "Hello, \(world)!", len: 13 )

x = f( x * 3 + 5 )

print( "unexpected error!" )

These spaces create very useful visual distinction between the function and their parameters, which helps a lot with avoiding the density that results from having no spaces there, visually merging the function name and parameters, increasing cognitive load.

Related & based on the same rationale, we might also consider spaces inside collections:

[ .foo: "Foo", .bar: "Bar" ]
[ .foo, .bar ]

Existing spaces inside parenthesis are currently removed by the following rules:

  • spaceInsideParens
  • wrap
  • wrapArguments
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