zokugun / vscode-explicit-folding

Customize your Folding for Visual Studio Code
MIT License
95 stars 14 forks source link

remember collapsed regions #78

Closed daiyam closed 1 year ago

daiyam commented 2 years ago

When I change the option in folding strategy from auto to indentation and reopen vscode, it does remember which functions were folded and which weren't. However, this type of folding is very weird as it folds empty lines and things outside brackets :/

image

Originally posted by @R3uan3 in https://github.com/zokugun/vscode-explicit-folding/issues/64#issuecomment-1089241520

daiyam commented 2 years ago

@R3uan3 I've opened a new issue for the one you have raised.

R3uan3 commented 2 years ago

Thank you! Im following it 👍

daiyam commented 2 years ago

@R3uan3 After testing, if you use the setting "explicitFolding.delay": 0,, vscode should remember the collapsed regions...

The issue is that I'm adding a delay (by default) to register the folding provider so it have higher priority over builtin ones. By doing so, when restoring the collapsed regions and since the provider isn't registered yet, vscode regenerate the folding regions...

R3uan3 commented 2 years ago

Thank you! Question: there are any cons of letting it at 0?


If I could report one more 'issue':

While editing a code if you delete one of the brackets the code move around (I mean it changes the current line being shown) and when you remove the second it tries to return to the previous line, but it returns to a different position.

When I remove the } in the script at the left on line 115, looks at how the script on the right behaves; before removing } the first line at the right is 11524 after its 10960, then when I restore the } in the script at the left, the script on the right still continues at 10960

It's just an exampleto demonstrate what I'm talking about.

When I'm editing any script and for any reason, i remove a bracket, it messy the entire position of the same scripts open on the editor. @daiyam

R3uan3 commented 2 years ago

@daiyam so? is this caused by the extension?

daiyam commented 2 years ago

@R3uan3 I don't think so since the extension is just reading the files and tell vscode where the foldings are. Then vscode merge all foldings and display them...

R3uan3 commented 2 years ago

@daiyam could you teach me how to compile your extension? I have never compiled or worked in any vscode extension before.

I have download nodejs and your extension src, then I install npm execute cmd > cd project folder > npm install package.json

what next? I'm completely lost, I wonder if you could guide me on this task 🙏

daiyam commented 2 years ago

In Visual Studio Code's menu, go to View/Run, then launch Extension. It will run the extension in debug and prelaunch the task npm: watch.

R3uan3 commented 2 years ago

@daiyam do you accept paid requests for editing vscode extensions? there's an extension that I would like to change some settings, if you do, can I have your contact then we can talk about it?

daiyam commented 2 years ago

You can contact me at daiyam@zokugun.org

daiyam commented 1 year ago

It should be resolved with editor.defaultFoldingRangeProvider