-
Notifications
You must be signed in to change notification settings - Fork 8
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
Anyway to fold / collapse just for organization purpose inside a uBO filter with VscodeAdblackSyntax ? #139
Comments
Currently, folding is only available for preprocessor directives, and there is no option to configure custom folding in the extension. Grouping and categorizing rules are planned features, and I think we don’t anticipate implementing these in the near future. Our filter team uses the Comment Anchors extension for categorization: Comment Anchors on Visual Studio Marketplace. |
Could we add the VS Code built-in code folding feature (#region / #endregion) for AdBlock filter files? AutoHotKey Plus Plus extension for VS Code is providing the VS Code folding #region / #endregion for .ahk files. This extension has the same purpose as VscodeAdblackSyntax for Adblock filter files but for AutoHotKey files. |
Willing to update this to follow the vscode's marker format for other languages? A 3rd party extension shouldn't be needed when most IDE's follow a pretty consistent format. If you're willing to put in the PR it's just a quick update of language-configuration.json file to update folding.markers.start to: and folding.markers.end to: This should make cold folding very intuitive. In addition to existing '!#if ' and '!#endif' (start/end respectively), it adds the start and end of !region/!endregion and !#region/!#endregion (with optional spaces) |
My suggested change above wouldn't work PERFECTLY to achieve your exact current formatting, but if you NEED to use this exact format, I'm not sure if you're aware, but you can manually create folding ranges from a selection. I didn't know this existed until just now. Of course, this isn't helpful for teams that maintain filterlists, but if it's just you, better than nothing... |
To illustrate, when you use AutoHotKey Plus Plus extension for VS Code, #region #endregion collapse is built-in :
Can I add this to VscodeAdblackSyntax configuration to get this #region / #enregion folding? or it has to be done by a dev then this will be too complex for me sadly. I tried using the manual folding range, as I cannot develop an Adblock filter without code folding. Unfortunately, it is not usable as my files are synchronized. So even for a single user, you cannot use this . As you pointed out it is also not usable in teamwork which is frequent for Adblock filters. |
@minig0d With this folding approach, the likely issue is that the markers won't form proper pairs. In other words, The ideal solution would likely involve making folding pairs (start and end regex) configurable through the settings as an array. Then, we could programmatically define the ranges using the |
Hi, We are editing uBO filters in VS Code using VscodeAdblackSyntax. Can we use a symbol or a formatting to fold/collapse sections for presentation clarity?
Currently, we are using this presentation format:
Here is an example:
It is not ideal because there is no folding / collapse possibility.
VscodeAdblackSyntax offers folding for pre-parsing directives like !#if / !#endif
but pre-parsing directives are for coding purposes, not just display purposes. Is there a better way than writting this:
The text was updated successfully, but these errors were encountered: