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

Display Folded Brackets or Parentheses on the Same Line with Ellipses Between #97

Closed
thomastthai opened this issue Jan 13, 2023 · 4 comments

Comments

@thomastthai
Copy link

thomastthai commented Jan 13, 2023

When brackets are folded, the closing bracket is displayed on the next line unless foldLastLine: true is set -- in which case that last closing bracket is not shown. That seems to work as intended. However, providing an option to display the folded region on one line with the closing bracket or parenthesis like:

  • function {...}
  • AppBar (...)
  • array [...]

could be more visibly succinct and intuitive.

Additional reference

@daiyam
Copy link
Member

daiyam commented Jan 13, 2023

if the closing bracket is displayed on the next line, it most likely that the folding region is from the default folding provider and not from this extension.
What are your settings?

In any case, even if correctly configured, you will only see function {... and not function {...}.

@thomastthai
Copy link
Author

"editor.defaultFoldingRangeProvider": "zokugun.explicit-folding",
  "explicitFolding.rules": {
    "*": [
      {
        "begin": "{",
        "end": "}",
        "foldLastLine": true
      },
      {
        "begin": "[",
        "end": "]",
        "foldLastLine": true
      },
      {
        "begin": "(",
        "end": ")",
        "foldLastLine": true
      }
    ]
  },

What changes is needed to get the function {...} to display?

@daiyam
Copy link
Member

daiyam commented Jan 14, 2023

I can't reproduce your issue. From my tests, when the "foldLastLine": true are removed, the folding regions are folded on a single line.
By default, foldLastLine is true. So it's weird!

Do you have an example?

To have function {...}, you will to changes VSCode... since this extension only provides a list folding regions.

@thomastthai
Copy link
Author

thomastthai commented Jan 14, 2023

I checked again and commented out all the //"foldLastLine": true and it does fold to one line. That was the behavior with VSCode with various extensions installed prior to installing vscode-explicit-folding. After installing and setting the recommended configs were in place the closing bracket started appearing on the next line. That was when //"foldLastLine": true was set. If the case comes up again, I'll look into it further and post.

It's unfortunate VSCode doesn't have the option to place the closing bracket on the same line after the ellipse.

Keep up the excellent work with vscode-explicit-folding extension.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants