atom / language-go

Go language package for Atom
Other
106 stars 65 forks source link

Fold select, switch, case #164

Closed Ben3eeE closed 6 years ago

Ben3eeE commented 6 years ago

Requirements

Description of the Change

Fixes https://github.com/atom/language-go/issues/163 by adding fold rules for switch, select and case.

Alternate Designs

N/A

Benefits

Can fold select switch and case

Possible Drawbacks

Someone wants to be unable to fold these things

Applicable Issues

Fixes https://github.com/atom/language-go/issues/163

/cc: @maxbrunsfeld

Ben3eeE commented 6 years ago

Edit: nevermind this doesn't make sense because then the entire else { would be on the same line as well.

While testing this I noticed that if else and if else if doesn't fold correctly:

if else image

if image

Code from https://gobyexample.com/if-else

I would expect both cases to fold the same way but it doesn't. I have idea how to fix this.

maxbrunsfeld commented 6 years ago

📈

toasa commented 6 years ago

thank you