-
Notifications
You must be signed in to change notification settings - Fork 3
How to use code folding premium feature? #85
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
Comments
Code folding is not supported for this text editor. (Both the server and text editor need to support it) |
Feature request is here sublimehq/sublime_text#3389 |
But in sublime I can do |
There is no ST API to influence where folder regions should be shown. It can only do it itself based on syntax. |
I have experimented with this on a branch https://github.com/jwortmann/LSP/tree/fold for the LSP package and created a PR at sublimelsp/LSP#2304. The automatic folding on file open should work™ with that branch if you configure the new setting, e.g. {
"initially_folded": ["declaration"],
} (the setting name is possibly not final), and using the corresponding And it's only active for newly opened files, i.e. not for the very first file which starts the language server (the intention for this is that parts of the file won't suddenly fold when the file is already open for a few seconds). The aspect that is not supported by Sublime Text, is to control the folding buttons in the gutter from a plugin. So you will not see any new folding buttons from LSP there. It's still a pull request / work in progress, so no guarantee that it will become available like this in the next LSP release, but in case you'd like to try it out, any feedback is welcome. Edit: Assuming "use declarations" in PHP are something like imports, |
Thank you @jwortmann, this feature is awesome. Though seems to consume quite a bit of ram. |
Thanks, glad that it's useful. But I'm a bit surprised that you experienced higher ram consumption. Iirc there should only be a single request to the server whenever a new file gets opened, and also only one ST API call if applicable. So there is nothing which would run in the background, or on file modifications or similar. And I couldn't imagine that it had any performance impacts. Maybe we should keep an eye on it... |
Closed since the |
@jwortmann is it possible to add a setting where you could set a minimum number of declaration lines for the declarations folding to be triggered? For example, when there are only five declaration lines, I don't want them to be folded. |
I have a license and I'd like to use Code folding feature, but cannot find where to set it. Namely I want to have use declarations folded when I open a file.
The text was updated successfully, but these errors were encountered: