30

Since the recent GoLand update I am seeing all return statements folded, as in the image below.

GoLand folded/hidden return statement

How can I make GoLand show all return statements not folded or hidden, as they are in the actual code?

sdgluck
  • 24,894
  • 8
  • 75
  • 90

1 Answers1

42

Go to Settings/Preferences | Editor | General | Code Folding | Go and toggle them on/off as needed.

To make this happen for new projects as well, go to File/Apple menu | Other Settings | Settings for New Projects | Editor | General | Code Folding | Go and toggle them there.

Feedback on why you don't want these and for how long you tried them would be useful.

Pang
  • 9,564
  • 146
  • 81
  • 122
dlsniper
  • 7,188
  • 1
  • 35
  • 44
  • 5
    Thanks! I used it for a week. I find it detracts from code readability due to the way I am used to scanning for error handling in Go code. However, I am biased due to being opposed generally to IDEs modifying the presentation of code. – sdgluck Dec 13 '19 at 11:49
  • 5
    It is becoming extremely unreadable. I've used it for a day. The first few hours it seemed as a very good idea though... – Hulii Borys Feb 11 '20 at 15:02
  • 1
    No such settings in "Settings for New Projects" in GoLand 2020.1.3 on Windows. – Pang Jun 26 '20 at 03:36
  • 1
    I also feel like this subtracts readability personally – Alvaro Dec 24 '20 at 19:14
  • 3
    I've used it for a while before finally finding a way to turn it off. Annoyed the whole way through. I still haven't managed to turn off != presentation as crossed equal sign. I feel that language designers already spent a lot of time designing the language for readability (especially go). And for better or worse, it is what it is. For an IDE to try to "improve" it by inventing new notations just serves to confuse things. I want to know exactly what complier will be seeing. Not some filtered and intermediated view. – Dmitry Serebrennikov Jan 08 '21 at 02:01
  • > I still haven't managed to turn off != presentation as crossed equal sign That is part of the Settings/Preferences | Editor | Font | Enable font ligatures. You can disable that, and it will be revert to what you are used to seeing. Also, thanks to everyone for the feedback. – dlsniper Jan 12 '21 at 06:55
  • 1
    I turned this off within 1 hour of using it. Error handling is important, especially in Go where error handling is required by default, so I need to look at the error clauses to make sure they're correct. – frodo2975 Aug 16 '21 at 19:53
  • I finally got annoyed enough to turn these off after about a year of using them because they cause surprising behavior when editing with Vim keys. – Grayson May 16 '23 at 19:01