Skip to content

Folding: Allow option to leave closing brace line visible #1514

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

Closed
RussPitcher opened this issue Sep 3, 2018 · 0 comments · Fixed by #1557
Closed

Folding: Allow option to leave closing brace line visible #1514

RussPitcher opened this issue Sep 3, 2018 · 0 comments · Fixed by #1557
Labels
Area-Folding Issue-Enhancement A feature request (enhancement).

Comments

@RussPitcher
Copy link

Summary of the new feature

As a user I want an option for brace-delimited code folding regions to leave the closing brace visible when the region is folded.

The current folding behaviour of VSCode with the PowerShell folding provider disabled leaves the opening and closing lines visible and folds the code in the contained lines.
image

With the PowerShell syntax-aware folding enabled the last line is also collapsed into the fold.
image
This means that any subsequent code blocks in the same construct are hidden and this obscures the code structure too much.

Would it be possible to either change the folding to match the default behaviour of VSCode indent-based folding or, preferably, add an option to allow a choice of behaviour?

@rjmholt rjmholt added Issue-Enhancement A feature request (enhancement). Area-Folding labels Sep 4, 2018
glennsarti added a commit to glennsarti/vscode-powershell that referenced this issue Sep 28, 2018
…ult VSCode

Changes the default to true
Adds tests
glennsarti pushed a commit to glennsarti/vscode-powershell that referenced this issue Oct 2, 2018
glennsarti added a commit to glennsarti/vscode-powershell that referenced this issue Oct 2, 2018
…ult VSCode

Previously the code folding provider would hide the last line of the region,
however the default VS Code code folding behaviour is to instead hide from
the beginning to end minus one, lines.  This commit;

* Adds a configuration parameter to show/hide the last line in a region,
  defaulting to Show the last line
* Modifies conversion method for the internal region class to FoldingRange
  object to show/hide the last line based on the extension settings
* Modifies the tests for the default value and adds tests for the show and hide
  scenarios

This code is based on a solution created by;
ens-rpitcher <[email protected]>
glennsarti added a commit to glennsarti/vscode-powershell that referenced this issue Oct 9, 2018
…ult VSCode

Previously the code folding provider would hide the last line of the region,
however the default VS Code code folding behaviour is to instead hide from
the beginning to end minus one, lines.  This commit;

* Adds a configuration parameter to show/hide the last line in a region,
  defaulting to Show the last line
* Modifies conversion method for the internal region class to FoldingRange
  object to show/hide the last line based on the extension settings
* Modifies the tests for the default value and adds tests for the show and hide
  scenarios

This code is based on a solution created by;
ens-rpitcher <[email protected]>
TylerLeonhardt pushed a commit that referenced this issue Oct 23, 2018
…#1557)

Previously the code folding provider would hide the last line of the region,
however the default VS Code code folding behaviour is to instead hide from
the beginning to end minus one, lines.  This commit;

* Adds a configuration parameter to show/hide the last line in a region,
  defaulting to Show the last line
* Modifies conversion method for the internal region class to FoldingRange
  object to show/hide the last line based on the extension settings
* Modifies the tests for the default value and adds tests for the show and hide
  scenarios

This code is based on a solution created by;
ens-rpitcher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Folding Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants