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

Enabling code folding by default #4566

Closed
mhutch opened this Issue Apr 13, 2018 · 14 comments

Comments

Projects
None yet
7 participants
@mhutch
Member

mhutch commented Apr 13, 2018

Developers often ask for code folding to be supported. We have this feature, but since it's off by default (unlike any other editor or IDE with this feature I can think of), they assume we don't have it and don't even look for the feature.

We should enable this by default (including for existing users).

Additionally, we should reduce the visual noise by following what VS Code does:

  • the current version of the fold margin is only displayed when hovering over it
  • when not hovering, the fold margin only shows [+] expand markers.

VS bug #600192

@mkrueger

This comment has been minimized.

Contributor

mkrueger commented Apr 16, 2018

I remember that I once implemented an on hover solution ... but no one wanted it at that time :/.

@Therzok

This comment has been minimized.

Member

Therzok commented Apr 16, 2018

Btw, vs editor/roslyn already do folding. We should switch our custom ast parser

@slluis

This comment has been minimized.

Member

slluis commented Apr 16, 2018

@migueldeicaza ok to change the default behavior?

@Therzok

This comment has been minimized.

Member

Therzok commented Apr 16, 2018

@Therzok

This comment has been minimized.

@nosami

This comment has been minimized.

Member

nosami commented Apr 16, 2018

Would it also be possible to stop the folds from automatically expanding when you move the caret across a fold? This makes folds almost pointless IMO (unless you only ever move the caret using the mouse)

@mkrueger

This comment has been minimized.

Contributor

mkrueger commented Apr 16, 2018

The folding translation has nothing to do with the default behavior - do not mix up things up. This issue is about turning on foldings as default and nothing more.

For C# the parsed document should be unused in any case btw. This is legacy infrastructure which is not needed for roslyn anymore.

@Therzok

This comment has been minimized.

Member

Therzok commented Apr 16, 2018

@mkrueger yeah, it's currently used, at least for the path selector.

@slluis

This comment has been minimized.

Member

slluis commented Apr 16, 2018

By "changing default behavior" I meant changing the default value of the option. I wasn't replying to Marius.

mkrueger added a commit that referenced this issue Apr 17, 2018

Fixes issue #4566 Enabling code folding by default
#4566

Should match the VS.NET default options.
@jmatthiesen

This comment has been minimized.

Contributor

jmatthiesen commented Apr 20, 2018

@mhutch I agree it would be great to separate out the design from enabling/disabling this feature by default. @slluis FWIW, we've seen a bit of customer feedback that users don't realize we have code folding. It's also common any more for editors to have this enabled by default. For these two reasons, I'm all good with this change, too.

@mhutch

This comment has been minimized.

Member

mhutch commented Apr 20, 2018

@nosami you should file a separate issue for that

@mkrueger

This comment has been minimized.

Contributor

mkrueger commented Apr 25, 2018

@Therzok : I didn't mean it is unused now - I work on the parsed document usage from time to time to remove it. It's not a super urgent thing to do but the goal is not longer using the parsed document infrastructure for c#. Roslyn is a complete replacement for all the parsed document features.

However we'll need it for xml or other languages for a while because roslyn is not really extensible enough to provide everything yet. So it's a poor mans solution for the other use cases we have.

@mkrueger

This comment has been minimized.

Contributor

mkrueger commented Apr 25, 2018

mhutch added a commit that referenced this issue Apr 26, 2018

Merge pull request #4587 from mono/master-issue4566
Fixes issue #4566 Enabling code folding by default
@xamarin-release-manager

This comment has been minimized.

Contributor

xamarin-release-manager commented Apr 26, 2018

Fixed in version 7.6.0.683 (master)

Pull Request #4587 merged by: Mikayla Hutchinson
Author: mono
Commit: 0ddb16e (mono/monodevelop)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment