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

Section folding #12

Closed
hifismith opened this issue Jun 6, 2022 · 4 comments
Closed

Section folding #12

hifismith opened this issue Jun 6, 2022 · 4 comments

Comments

@hifismith
Copy link

Can sections and subsections be recognized and folded? In the screenshot I've used cmnd+K+0 to fold everything, but the sections and subsections are expanded.
image

@bostick
Copy link

bostick commented Jun 6, 2022

Sure, I will add this in the next few days.

@bostick
Copy link

bostick commented Jun 15, 2022

I've added foldingRange support in the latest push of this repo:
https://github.com/WolframResearch/LSPServer.

You can test this by building the paclet from source, Otherwise, I will be making an update in the next few weeks, and your paclet will update automatically.

@hifismith
Copy link
Author

Nice! Thanks. I'll have to try it when the update comes out.

@bostick bostick closed this as completed Jun 23, 2022
@hifismith
Copy link
Author

@bostick , it appears something has changed in the LSPServer. Section folding has a bug now. It's Christmas Eve so please don't work on this until you're back in the office.

This code shows the "Import" section declaration and then a function, which I've folded, followed by the initialization of variable 'sheets'
image

This "Import" section goes until line 470, but when I fold it, you'll see it only folds that first function.
image

A couple things stand out.

  1. Folding functions is a new feature I believe. It seems to be interfering with the section folding.
  2. The function folding is a nice feature that would be awesome to add to other large expression constructs like With, Block, Module, etc. For example, the next bit of code is a function encapsulated within a "With" expression. I am unable to fold it because of the encapsulation. It'd be nice to be able to fold the With statement:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants