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

Preserving the space before/after [ ( #14

Closed
basetta opened this issue Mar 24, 2011 · 8 comments
Closed

Preserving the space before/after [ ( #14

basetta opened this issue Mar 24, 2011 · 8 comments

Comments

@basetta
Copy link

basetta commented Mar 24, 2011

Hi,
at work we adopted the following standard

instead of

def main(args : Array[String]) def main( args : Array[ String ] )

I think it improves the readibility of the code IMHO.

Is it possible to preserve those spaces ?

Thx
Pat

@mdr
Copy link
Collaborator

mdr commented Mar 25, 2011

Should be doable. So to clarify -- you want an option for Scalariform to put spaces after and before opening and closing parens ( ) and brackets [ ] respectively, wherever they occur in the syntax (e.g. tuples, class params, method invocations, for/if-else/while etc...)?

@basetta
Copy link
Author

basetta commented Mar 25, 2011

Thx :)

It would be nice having:

  • class params
  • method params
  • tuples => ( 1, 2 )
  • type definition => List[ String ] => val l : List[ String ] = List( "pippo", "pluto" )
  • method invocation => like println( "asdas" ) but not runIt()
  • also for the construct for/if/while and so on => if ( pippo==pluto )

Ah right we would like to keep it also for {} in xml snipset eg:

<pippo> <name> { getName() } </name> </pippo>

That's it right now nothing else is crossing my mind

Thx
Pat

@mdr
Copy link
Collaborator

mdr commented Mar 25, 2011

OK, I'll have a crack at it over the weekend if I get chance.

To clarify on this case:

<name> { getName() } </name> 

Did you mean spaces outside of the braces? (The current version will put spaces inside the braces).

@basetta
Copy link
Author

basetta commented Mar 25, 2011

no sorry only inside the braces :)

@mdr
Copy link
Collaborator

mdr commented Mar 26, 2011

Add SpaceInsideParentheses and SpaceInsideBrackets preferences (closed by 9255ed4)

@mdr mdr closed this as completed Mar 26, 2011
@mdr
Copy link
Collaborator

mdr commented Mar 26, 2011

Righty, I've added the above preferences for this -- hopefully it does what you want,

-- Matt

@basetta
Copy link
Author

basetta commented Mar 28, 2011

thanks a lot. I will test tonight.

Thanks again :)

@epmartini
Copy link

Thanks it works perfectly

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

No branches or pull requests

3 participants